<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Compile Invocations Inline</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Compile Invocations Inline' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../inform7n.html">Inform7</a></li><li><a href="index.html">imperative</a></li><li><a href="index.html#5">Chapter 5: Invocations</a></li><li><b>Compile Invocations Inline</b></li></ul></div>
<p class="purpose">Here we generate Inter code to invoke a phrase from its inline definition.</p>

<ul class="toc"><li><a href="5-cii.html#SP1">&#167;1. Introduction</a></li><li><a href="5-cii.html#SP3">&#167;3. Front and back</a></li><li><a href="5-cii.html#SP5">&#167;5. Single schemas</a></li><li><a href="5-cii.html#SP7">&#167;7. Bracings for tokens</a></li><li><a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4. Annotation commands for bracings with natural language</a></li><li><a href="5-cii.html#SP9">&#167;9. Try and try silently</a></li><li><a href="5-cii.html#SP6_2">&#167;6.2. Commands about kinds</a></li><li><a href="5-cii.html#SP6_3">&#167;6.3. Typographic commands</a></li><li><a href="5-cii.html#SP6_4">&#167;6.4. Label or counter commands</a></li><li><a href="5-cii.html#SP6_5">&#167;6.5. High-level commands</a></li><li><a href="5-cii.html#SP6_6">&#167;6.6. Miscellaneous commands</a></li><li><a href="5-cii.html#SP6_7">&#167;6.7. Primitive definitions</a></li><li><a href="5-cii.html#SP10">&#167;10. Parsing the invocation operands</a></li><li><a href="5-cii.html#SP12">&#167;12. Bracket-plus notation</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. Introduction.</b>In "CSI: Inline", which premieres Thursday at 9, Jack "The Invoker" Flathead,
lonely but brilliant scene of crime officer, tells it like it is, and as serial
killers stalk the troubled streets of Inline, Missouri, ... Well, no: CSI
stands here for "compile single invocation", and this is the harder case where
the phrase being invoked has an inline definition.
</p>

<p class="commentary">Inline definitions vary considerably in both simplicity and their legibility
to human eyes. Here is the text substitution "[bold type]":
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">say</span><span class="plain-syntax"> </span><span class="identifier-syntax">bold</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax"> -- </span><span class="identifier-syntax">running</span><span class="plain-syntax"> </span><span class="identifier-syntax">on:</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">style</span><span class="plain-syntax"> </span><span class="identifier-syntax">bold</span><span class="plain-syntax">; -).</span>
</pre>
<p class="commentary">On the other hand, here is how to repeat through a table:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">repeat</span><span class="plain-syntax"> </span><span class="identifier-syntax">through</span><span class="plain-syntax"> (</span><span class="identifier-syntax">T</span><span class="plain-syntax"> - </span><span class="identifier-syntax">table</span><span class="plain-syntax"> </span><span class="identifier-syntax">name</span><span class="plain-syntax">) </span><span class="identifier-syntax">in</span><span class="plain-syntax"> (</span><span class="identifier-syntax">TC</span><span class="plain-syntax"> - </span><span class="identifier-syntax">table</span><span class="plain-syntax"> </span><span class="identifier-syntax">column</span><span class="plain-syntax">) </span><span class="identifier-syntax">order</span><span class="plain-syntax"> </span><span class="identifier-syntax">begin</span><span class="plain-syntax"> -- </span><span class="identifier-syntax">end</span><span class="plain-syntax"> </span><span class="identifier-syntax">loop</span>
<span class="plain-syntax">    (-</span>
<span class="plain-syntax">        @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> {-</span><span class="identifier-syntax">my:ct_0</span><span class="plain-syntax">}; @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> {-</span><span class="identifier-syntax">my:ct_1</span><span class="plain-syntax">};</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> ({-</span><span class="identifier-syntax">my:1</span><span class="plain-syntax">}={</span><span class="identifier-syntax">T</span><span class="plain-syntax">}, {-</span><span class="identifier-syntax">my:2</span><span class="plain-syntax">}=</span><span class="identifier-syntax">TableNextRow</span><span class="plain-syntax">({-</span><span class="identifier-syntax">my:1</span><span class="plain-syntax">}, {</span><span class="identifier-syntax">TC</span><span class="plain-syntax">}, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">), </span><span class="identifier-syntax">ct_0</span><span class="plain-syntax">={-</span><span class="identifier-syntax">my:1</span><span class="plain-syntax">}, </span><span class="identifier-syntax">ct_1</span><span class="plain-syntax">={-</span><span class="identifier-syntax">my:2</span><span class="plain-syntax">}:</span>
<span class="plain-syntax">            {-</span><span class="identifier-syntax">my:2</span><span class="plain-syntax">}~=0:</span>
<span class="plain-syntax">            {-</span><span class="identifier-syntax">my:2</span><span class="plain-syntax">}=</span><span class="identifier-syntax">TableNextRow</span><span class="plain-syntax">({-</span><span class="identifier-syntax">my:1</span><span class="plain-syntax">}, {</span><span class="identifier-syntax">TC</span><span class="plain-syntax">}, {-</span><span class="identifier-syntax">my:2</span><span class="plain-syntax">}, </span><span class="constant-syntax">1</span><span class="plain-syntax">), </span><span class="identifier-syntax">ct_0</span><span class="plain-syntax">={-</span><span class="identifier-syntax">my:1</span><span class="plain-syntax">}, </span><span class="identifier-syntax">ct_1</span><span class="plain-syntax">={-</span><span class="identifier-syntax">my:2</span><span class="plain-syntax">})</span>
<span class="plain-syntax">                {-</span><span class="identifier-syntax">block</span><span class="plain-syntax">}</span>
<span class="plain-syntax">        @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> {-</span><span class="identifier-syntax">my:ct_1</span><span class="plain-syntax">}; @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> {-</span><span class="identifier-syntax">my:ct_0</span><span class="plain-syntax">};</span>
<span class="plain-syntax">    -).</span>
</pre>
<p class="commentary">Inline definitions are written in a highly annotated and marked-up version of
Inform 6 notation, but are not actually I6 code.
</p>

<p class="commentary">That second example is a case where the definition has a "back" as well as a
"front". All definitions have a front; only if the text contains a <span class="extract"><span class="extract-syntax">{-block}</span></span>
marker is there a back as well. The front is the material up to the marker, the
back is the material after it. The idea, of course, is that for inline
definitions of control structures involving blocks of code, we compile the
front material before compiling the block, and the back material afterwards.
</p>

<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>The process of compiling from an inline definition is a little like
interpreting a program, and a <a href="5-cii.html#SP2" class="internal">csi_state</a> object represents the state of
the (imaginary) computer doing that.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">csi_state</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">source_location</span><span class="plain-syntax"> *</span><span class="identifier-syntax">where_from</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">value_holster</span><span class="plain-syntax"> </span><span class="identifier-syntax">VH</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">id_body</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idb</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">inv</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">tokens_packet</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">local_variable</span><span class="plain-syntax"> *</span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">[10]; </span><span class="comment-syntax"> the "my" variables 0 to 9</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">csi_state</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>The structure csi_state is accessed in 3/cb and here.</li></ul>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. Front and back.</b>The function <a href="5-cii.html#SP3" class="internal">CSIInline::csi_inline</a> compiles from the front of the definition, but not
the back (if it has one). The back won't appear until much later on, when the
new code block finishes. We won't live to see it; in this function, all we do
is pass the tailpiece to the code block handler, to be spliced in later on.
</p>

<p class="commentary">Note that if there is a code block, then any "my" variables created in this
invocation are preserved &mdash; the back part of the definition may want to use
them. They will disappear anyway in that event, because their scope is set to
the code block in question.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">CSIInline::csi_inline</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">CSIInline::csi_inline</span></span>:<br/>Compile Invocations - <a href="5-ci.html#SP4_1_2">&#167;4.1.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">value_holster</span><span class="plain-syntax"> *</span><span class="identifier-syntax">VH</span><span class="plain-syntax">, </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">source_location</span><span class="plain-syntax"> *</span><span class="identifier-syntax">where_from</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">tokens_packet</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">VH</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">vhmode_wanted</span><span class="plain-syntax"> == </span><span class="identifier-syntax">INTER_VAL_VHMODE</span><span class="plain-syntax">) </span><span class="identifier-syntax">VH</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">vhmode_provided</span><span class="plain-syntax"> = </span><span class="identifier-syntax">INTER_VAL_VHMODE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">VH</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">vhmode_provided</span><span class="plain-syntax"> = </span><span class="identifier-syntax">INTER_VOID_VHMODE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">csi_state</span><span class="plain-syntax"> </span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">id_body</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_phrase_invoked</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP3_1" class="named-paragraph-link"><span class="named-paragraph">Initialise the CSI state</span><span class="named-paragraph-number">3.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP3_2" class="named-paragraph-link"><span class="named-paragraph">Create any new local variables explicitly called for</span><span class="named-paragraph-number">3.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="5-cii.html#SP5" class="function-link"><span class="function-syntax">CSIInline::from_schema</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">idb</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">head_of_defn</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">at</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="3-cid.html#SP6" class="function-link"><span class="function-syntax">CompileImperativeDefn::get_front_schema</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">idb</span><span class="plain-syntax">), &amp;</span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">IDTypeData::block_follows</span><span class="plain-syntax">(</span><span class="identifier-syntax">idb</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-cb.html#SP10" class="function-link"><span class="function-syntax">CodeBlocks::attach_back_schema</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><a href="3-cid.html#SP6" class="function-link"><span class="function-syntax">CompileImperativeDefn::get_back_schema</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">idb</span><span class="plain-syntax">), </span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(),</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_LoopWithoutBody</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                </span><span class="string-syntax">"there doesn't seem to be any body to this phrase"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="string-syntax">"in the way that a 'repeat', 'if' or 'while' is expected to have."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP3_3" class="named-paragraph-link"><span class="named-paragraph">Release any my-variables created inline</span><span class="named-paragraph-number">3.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">idb</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">inline_mor</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3_1" class="paragraph-anchor"></a><b>&#167;3.1. </b>The 10 variable registers hold the identities of local variables created inside
the inline definition using <span class="extract"><span class="extract-syntax">{-my:0}</span></span> to <span class="extract"><span class="extract-syntax">{-my:9}</span></span>: they're <span class="extract"><span class="extract-syntax">NULL</span></span> until used, and
are mostly not used. The "repeat" example above uses <span class="extract"><span class="extract-syntax">{-my:1}</span></span>, <span class="extract"><span class="extract-syntax">{-my:2}</span></span>, and
<span class="extract"><span class="extract-syntax">{-my:3}</span></span>, but leaves the others null. Most definitions use none of them.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Initialise the CSI state</span><span class="named-paragraph-number">3.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">.</span><span class="element-syntax">where_from</span><span class="plain-syntax"> = </span><span class="identifier-syntax">where_from</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">.</span><span class="element-syntax">VH</span><span class="plain-syntax"> = *</span><span class="identifier-syntax">VH</span><span class="plain-syntax">; </span><span class="comment-syntax"> copied because it might be on the C call stack</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">.</span><span class="element-syntax">idb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">idb</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">.</span><span class="element-syntax">inv</span><span class="plain-syntax"> = </span><span class="identifier-syntax">inv</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">.</span><span class="element-syntax">tokens</span><span class="plain-syntax"> = </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;10; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) </span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">.</span><span class="element-syntax">my_vars</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">] = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP3">&#167;3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP3_2" class="paragraph-anchor"></a><b>&#167;3.2. </b>But phrases can create local variables through notation in the prototype as
well as in the definition. Consider the prototype:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">repeat</span><span class="plain-syntax"> </span><span class="identifier-syntax">with</span><span class="plain-syntax"> (</span><span class="identifier-syntax">loopvar</span><span class="plain-syntax"> - </span><span class="identifier-syntax">nonexisting</span><span class="plain-syntax"> </span><span class="identifier-syntax">object</span><span class="plain-syntax"> </span><span class="identifier-syntax">variable</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">running</span><span class="plain-syntax"> </span><span class="identifier-syntax">through</span><span class="plain-syntax"> (</span><span class="identifier-syntax">L</span><span class="plain-syntax"> - </span><span class="identifier-syntax">list</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">values</span><span class="plain-syntax">) </span><span class="identifier-syntax">begin</span><span class="plain-syntax"> -- </span><span class="identifier-syntax">end</span><span class="plain-syntax"> </span><span class="identifier-syntax">loop:</span>
<span class="plain-syntax">    ...</span>
</pre>
<p class="commentary">Here, token 0, "nonexisting object variable", calls for us to create a new
local variable of kind "object" each time the phrase is invoked. This variable
may have a short lifetime, since its scope will be tied to the block of code
about to open.
</p>

<p class="commentary">Note that we do not initialise the variable &mdash; that would be inefficient, in that
such stores would be unnecessary in some cases. So the responsibility of ensuring
that the variable contains a typesafe value is placed on the inline definition.
If it abuses that responsibility, type safety is simply lost. Consider:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">conjure</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bus</span><span class="plain-syntax"> - </span><span class="identifier-syntax">nonexisting</span><span class="plain-syntax"> </span><span class="identifier-syntax">object</span><span class="plain-syntax"> </span><span class="identifier-syntax">variable</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- {</span><span class="identifier-syntax">bus</span><span class="plain-syntax">} = </span><span class="constant-syntax">26201</span><span class="plain-syntax">; -).</span>
<span class="identifier-syntax">When</span><span class="plain-syntax"> </span><span class="identifier-syntax">play</span><span class="plain-syntax"> </span><span class="identifier-syntax">begins:</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">conjure</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">magic</span><span class="plain-syntax"> </span><span class="identifier-syntax">bus</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">showme</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">magic</span><span class="plain-syntax"> </span><span class="identifier-syntax">bus</span><span class="plain-syntax">.</span>
</pre>
<p class="commentary">This will end horribly unless 26201 happens to be a valid object number, and it
almost certainly is not. But the Inform compiler throws no problem message, because
the code is legal. See the discussion of <span class="extract"><span class="extract-syntax">{-initialise:...}</span></span> for how to deal with
this issue.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create any new local variables explicitly called for</span><span class="named-paragraph-number">3.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">Invocations::get_no_tokens</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">); </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">];</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Invocations::get_token_variable_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">construct</span><span class="plain-syntax"> == </span><span class="identifier-syntax">CON_INTERMEDIATE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(),</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_DimensionallyImpossibleLetVariable</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                    </span><span class="string-syntax">"this variable does not have a kind I can use"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                    </span><span class="string-syntax">"since it results from performing arithmetic on other values "</span>
<span class="plain-syntax">                    </span><span class="string-syntax">"in a way which doesn't result in a kind that I recognise."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_number</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">local_variable</span><span class="plain-syntax"> *</span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> = </span><a href="3-lv.html#SP7" class="function-link"><span class="function-syntax">LocalVariables::new_let_value</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">), </span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">IDTypeData::block_follows</span><span class="plain-syntax">(</span><span class="identifier-syntax">idb</span><span class="plain-syntax">) == </span><span class="identifier-syntax">LOOP_BODY_BLOCK_FOLLOWS</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><a href="3-cb.html#SP18" class="function-link"><span class="function-syntax">CodeBlocks::set_scope_to_block_about_to_open</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">                </span><a href="3-cb.html#SP17" class="function-link"><span class="function-syntax">CodeBlocks::set_scope_to_current_block</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">] =</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Lvalues::new_LOCAL_VARIABLE</span><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">), </span><span class="identifier-syntax">lvar</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Behaviour::uses_block_values</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">lvar_s</span><span class="plain-syntax"> = </span><a href="3-lv.html#SP1" class="function-link"><span class="function-syntax">LocalVariables::declare</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">STORE_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">EmitCode::ref_symbol</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">lvar_s</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><a href="3-sf.html#SP21" class="function-link"><span class="function-syntax">Frames::emit_new_local_value</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP3">&#167;3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP3_3" class="paragraph-anchor"></a><b>&#167;3.3. </b>As we will see (in the discussion of <span class="extract"><span class="extract-syntax">{-my:...}</span></span> below), any variables made
as scratch values for the invocation are deallocated as soon as we're finished,
unless a code block is opened: if it is, then they're deallocated when it ends.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Release any my-variables created inline</span><span class="named-paragraph-number">3.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;10; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">.</span><span class="element-syntax">my_vars</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">])</span>
<span class="plain-syntax">            </span><a href="3-lvs.html#SP13" class="function-link"><span class="function-syntax">LocalVariableSlates::deallocate_I7_local</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">.</span><span class="element-syntax">my_vars</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">]);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP3">&#167;3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b>And this is what happens when the back part of the definition is finally
compiled.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">CSIInline::csi_inline_back</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">CSIInline::csi_inline_back</span></span>:<br/>Code Blocks - <a href="3-cb.html#SP13">&#167;13</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_schema</span><span class="plain-syntax"> *</span><span class="identifier-syntax">back</span><span class="plain-syntax">, </span><span class="reserved-syntax">csi_state</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">back</span><span class="plain-syntax">) </span><a href="5-cii.html#SP5" class="function-link"><span class="function-syntax">CSIInline::from_schema</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">, </span><span class="identifier-syntax">back</span><span class="plain-syntax">, </span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. Single schemas.</b>We can now forget about fronts and backs, and work on expanding a single
inline definition into a single stream.
</p>

<p class="commentary">We do this by calling the very powerful <span class="extract"><span class="extract-syntax">EmitInterSchemas::emit</span></span> function,
which parses the schema and calls us back to do something at each point in it.
In particular, it calls <a href="5-cii.html#SP6" class="internal">CSIInline::from_schema_token</a> on each "token" of
the schema, and calls <a href="5-cii.html#SP12" class="internal">CSIInline::from_source_text</a> on any material enclosed
in <span class="extract"><span class="extract-syntax">(+ ... +)</span></span> notation.
</p>

<p class="commentary"><span class="extract"><span class="extract-syntax">CSIS</span></span> is passed to this function as our "opaque state" &mdash; meaning that it is
passed through unchanged to our callback functions, and means that the code
below can share some private state variables.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">CSIInline::from_schema</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">CSIInline::from_schema</span></span>:<br/><a href="5-cii.html#SP3">&#167;3</a>, <a href="5-cii.html#SP4">&#167;4</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_schema</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sch</span><span class="plain-syntax">, </span><span class="reserved-syntax">csi_state</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">LinkedLists::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">sch</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">parsing_errors</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitInterSchemas::emit</span><span class="plain-syntax">(</span><span class="identifier-syntax">Emit::tree</span><span class="plain-syntax">(), &amp;(</span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">VH</span><span class="plain-syntax">), </span><span class="identifier-syntax">sch</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">IdentifierFinders::common_names_only</span><span class="plain-syntax">(),</span>
<span class="plain-syntax">            &amp;</span><a href="5-cii.html#SP6" class="function-link"><span class="function-syntax">CSIInline::from_schema_token</span></a><span class="plain-syntax">, &amp;</span><a href="5-cii.html#SP12" class="function-link"><span class="function-syntax">CSIInline::from_source_text</span></a><span class="plain-syntax">, </span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="3-cid.html#SP7" class="function-link"><span class="function-syntax">CompileImperativeDefn::issue_schema_errors</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="identifier-syntax">sch</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. </b>So we now have to write the function compiling code to implement <span class="extract"><span class="extract-syntax">ist</span></span>.
See <a href="../building-module/2-is.html" class="internal">Inter Schemas (in building)</a> for a specification of Inter schema tokens,
but roughly speaking each is either a command or a "bracing".
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">CSIInline::from_schema_token</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">CSIInline::from_schema_token</span></span>:<br/><a href="5-cii.html#SP5">&#167;5</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">value_holster</span><span class="plain-syntax"> *</span><span class="identifier-syntax">VH</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_schema_token</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ist</span><span class="plain-syntax">, </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CSIS_s</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">prim_cat</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arg_L</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">csi_state</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CSIS</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">csi_state</span><span class="plain-syntax"> *) </span><span class="identifier-syntax">CSIS_s</span><span class="plain-syntax">; </span><span class="comment-syntax"> recover the "opaque state"</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">id_body</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">idb</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">inv</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">inv</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">tokens_packet</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tokens</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tokens</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">local_variable</span><span class="plain-syntax"> **</span><span class="identifier-syntax">my_vars</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CSIS</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">my_vars</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">C</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">inline_command</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> != </span><span class="identifier-syntax">no_ISINC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">primitive_definition_ISINC</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_7" class="named-paragraph-link"><span class="named-paragraph">Expand an entirely internal-made definition</span><span class="named-paragraph-number">6.7</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2" class="named-paragraph-link"><span class="named-paragraph">Expand a bracing containing a kind command</span><span class="named-paragraph-number">6.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_3" class="named-paragraph-link"><span class="named-paragraph">Expand a bracing containing a typographic command</span><span class="named-paragraph-number">6.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_4" class="named-paragraph-link"><span class="named-paragraph">Expand a bracing containing a label or counter command</span><span class="named-paragraph-number">6.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5" class="named-paragraph-link"><span class="named-paragraph">Expand a bracing containing a high-level command</span><span class="named-paragraph-number">6.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_6" class="named-paragraph-link"><span class="named-paragraph">Expand a bracing containing a miscellaneous command</span><span class="named-paragraph-number">6.6</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">BRW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Feeds::feed_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">bracing</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1" class="named-paragraph-link"><span class="named-paragraph">Expand a bracing for a token or phrase option</span><span class="named-paragraph-number">6.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. Bracings for tokens.</b>For example, if the phrase prototype is <span class="extract"><span class="extract-syntax">print (something to say - text)</span></span>, then the
bracing <span class="extract"><span class="extract-syntax">{something to say}</span></span> refers to the token value at that point.
</p>

<p class="commentary">Such tokens can also be "annotated" with commands. <span class="extract"><span class="extract-syntax">{-by-reference:something to say}</span></span>
means the same but indicates that it should be compiled without copying.
</p>

<p class="commentary">Lastly, though this is much less common, the bracing can compile to the bitmap value
for a phrase option or for the current bitmap of options specified by the invocation.
Those have no annotations.
</p>

<p class="commentary">The natural language part must match this:
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">OPTS_INSUB</span><span class="plain-syntax"> -1</span>
<span class="definition-keyword">define</span> <span class="constant-syntax">LOCAL_INSUB</span><span class="plain-syntax"> -2</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="function-syntax">&lt;inline-bracing-source-text&gt;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">phrase</span><span class="plain-syntax"> </span><span class="identifier-syntax">options</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;phrase-option&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="function-syntax">&lt;name-local-to-inline-stack-frame&gt;</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    ...</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. </b>This matches one of the token names in the preamble to the inline definition.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="function-syntax">&lt;name-local-to-inline-stack-frame&gt;</span><span class="plain-syntax"> </span><span class="identifier-syntax">internal</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">local_variable</span><span class="plain-syntax"> *</span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><a href="3-lv.html#SP17" class="function-link"><span class="function-syntax">LocalVariables::parse</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">idb_being_parsed</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">id_stack_frame</span><span class="plain-syntax">), </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        ==&gt; { -, </span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> };</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    ==&gt; { </span><span class="identifier-syntax">fail</span><span class="plain-syntax"> </span><span class="identifier-syntax">nonterminal</span><span class="plain-syntax"> };</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7_1" class="paragraph-anchor"></a><b>&#167;7.1. </b>In my first draft of Inform, this problem message made reference to "meddling
charlatans" and what they "deserve". I'm a better person now.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue PM_BadInlineExpansion problem</span><span class="named-paragraph-number">7.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_wording</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_BadInlineExpansion</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="string-syntax">"You wrote %1, but when I looked that phrase up I found that its inline "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"definition included the bracing {%2}. Text written in braces like this, "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"in an inline phrase definition, should be one of the following: a name "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"of one of the tokens in the phrase, or a phrase option, or the text "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"'phrase options' itself. %PThe ability to write inline phrases is really "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"intended only for the Standard Rules and a few other low-level system "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"extensions. A good rule of thumb is: if you can define a phrase without "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"using I6 insertions, do."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    ==&gt; { </span><span class="identifier-syntax">fail</span><span class="plain-syntax"> </span><span class="identifier-syntax">nonterminal</span><span class="plain-syntax"> };</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP7">&#167;7</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1" class="paragraph-anchor"></a><b>&#167;6.1. </b>Acting on that:
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Expand a bracing for a token or phrase option</span><span class="named-paragraph-number">6.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">phod_being_parsed</span><span class="plain-syntax"> = &amp;(</span><span class="identifier-syntax">idb</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">type_data</span><span class="plain-syntax">.</span><span class="identifier-syntax">options_data</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">idb_being_parsed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">idb</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;inline-bracing-source-text&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">BRW</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;&lt;r&gt;&gt;</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">OPTS_INSUB:</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">current_opts</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Invocations::get_phrase_options_bitmap</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">EmitCode::val_number</span><span class="plain-syntax">((</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">current_opts</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">LOCAL_INSUB:</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">local_variable</span><span class="plain-syntax"> *</span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> = </span><span class="function-syntax">&lt;&lt;rp&gt;&gt;</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">tok</span><span class="plain-syntax"> = </span><a href="3-lv.html#SP3" class="function-link"><span class="function-syntax">LocalVariables::get_parameter_number</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tok</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1" class="named-paragraph-link"><span class="named-paragraph">Expand a bracing containing a token name</span><span class="named-paragraph-number">6.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">default:</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">this_opt</span><span class="plain-syntax"> = -</span><span class="function-syntax">&lt;&lt;r&gt;&gt;</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">current_opts</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Invocations::get_phrase_options_bitmap</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">current_opts</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">this_opt</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">EmitCode::val_number</span><span class="plain-syntax">(1);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">EmitCode::val_number</span><span class="plain-syntax">(0);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1" class="paragraph-anchor"></a><b>&#167;6.1.1. </b>At this point, the bracing text is the name of token number <span class="extract"><span class="extract-syntax">tok</span></span>. Usually
we compile the value of that argument as drawn from the tokens packet, but
the presence of annotations can change what we do.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Expand a bracing containing a token name</span><span class="named-paragraph-number">6.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">supplied</span><span class="plain-syntax"> = </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[</span><span class="identifier-syntax">tok</span><span class="plain-syntax">];</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">by_value_not_reference</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">require_to_be_lvalue</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4" class="named-paragraph-link"><span class="named-paragraph">Take account of any annotation to the inline token</span><span class="named-paragraph-number">6.1.1.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">kind_vars_inline</span><span class="plain-syntax">[27];</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_1" class="named-paragraph-link"><span class="named-paragraph">Work out values for the kind variables in this context</span><span class="named-paragraph-number">6.1.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> **</span><span class="identifier-syntax">saved</span><span class="plain-syntax"> = </span><a href="3-sf.html#SP8" class="function-link"><span class="function-syntax">Frames::temporarily_set_kvs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">kind_vars_inline</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">changed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">kind_required</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Kinds::substitute</span><span class="plain-syntax">(</span><span class="identifier-syntax">IDTypeData::token_kind</span><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">idb</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">type_data</span><span class="plain-syntax">), </span><span class="identifier-syntax">tok</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">kind_vars_inline</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">changed</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_2" class="named-paragraph-link"><span class="named-paragraph">If the token has to be an lvalue, reject it if it isn't</span><span class="named-paragraph-number">6.1.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_3" class="named-paragraph-link"><span class="named-paragraph">Compile the token value</span><span class="named-paragraph-number">6.1.1.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="3-sf.html#SP8" class="function-link"><span class="function-syntax">Frames::temporarily_set_kvs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">saved</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1">&#167;6.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_1" class="paragraph-anchor"></a><b>&#167;6.1.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Work out values for the kind variables in this context</span><span class="named-paragraph-number">6.1.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind_vars_inline</span><span class="plain-syntax">[0] = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=1; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;=26; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) </span><span class="identifier-syntax">kind_vars_inline</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">] = </span><a href="3-sf.html#SP8" class="function-link"><span class="function-syntax">Frames::get_kind_variable</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">i</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind_variable_declaration</span><span class="plain-syntax"> *</span><span class="identifier-syntax">kvd</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (; </span><span class="identifier-syntax">kvd</span><span class="plain-syntax">; </span><span class="identifier-syntax">kvd</span><span class="plain-syntax">=</span><span class="identifier-syntax">kvd</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next</span><span class="plain-syntax">) </span><span class="identifier-syntax">kind_vars_inline</span><span class="plain-syntax">[</span><span class="identifier-syntax">kvd</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">kv_number</span><span class="plain-syntax">] = </span><span class="identifier-syntax">kvd</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">kv_value</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1">&#167;6.1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_2" class="paragraph-anchor"></a><b>&#167;6.1.1.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">If the token has to be an lvalue, reject it if it isn't</span><span class="named-paragraph-number">6.1.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">require_to_be_lvalue</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">nonlocal_variable</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nlv</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Lvalues::get_nonlocal_variable_if_any</span><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (((</span><span class="identifier-syntax">nlv</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">NonlocalVariables::is_constant</span><span class="plain-syntax">(</span><span class="identifier-syntax">nlv</span><span class="plain-syntax">))) ||</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">Lvalues::is_lvalue</span><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">nlv</span><span class="plain-syntax">) </span><span class="identifier-syntax">Problems::quote_wording</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">nlv</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">Problems::quote_spec</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_NotAnLvalue</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                </span><span class="string-syntax">"You wrote %1, but that seems to mean changing '%2', which is a constant "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"and can't be altered."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1">&#167;6.1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_3" class="paragraph-anchor"></a><b>&#167;6.1.1.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Compile the token value</span><span class="named-paragraph-number">6.1.1.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">LOGIF</span><span class="plain-syntax">(</span><span class="identifier-syntax">MATCHING</span><span class="plain-syntax">, </span><span class="string-syntax">"Expanding $P into '%W' with %d, %u%s%s\n"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">BRW</span><span class="plain-syntax">, </span><span class="identifier-syntax">tok</span><span class="plain-syntax">, </span><span class="identifier-syntax">kind_required</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">changed</span><span class="plain-syntax">?</span><span class="string-syntax">" (after kind substitution)"</span><span class="plain-syntax">:</span><span class="string-syntax">""</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">by_value_not_reference</span><span class="plain-syntax">?</span><span class="string-syntax">" (by value)"</span><span class="plain-syntax">:</span><span class="string-syntax">" (by reference)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">by_value_not_reference</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><a href="2-cv.html#SP5" class="function-link"><span class="function-syntax">CompileValues::to_fresh_code_val_of_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">kind_required</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><a href="2-cv.html#SP5" class="function-link"><span class="function-syntax">CompileValues::to_code_val_of_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">kind_required</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1">&#167;6.1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4" class="paragraph-anchor"></a><b>&#167;6.1.1.4. Annotation commands for bracings with natural language.</b>These all modify the way a token is compiled.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Take account of any annotation to the inline token</span><span class="named-paragraph-number">6.1.1.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">valid_annotation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">C</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">inline_command</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">by_reference_ISINC</span><span class="plain-syntax">)           </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_1" class="named-paragraph-link"><span class="named-paragraph">Inline annotation "by-reference"</span><span class="named-paragraph-number">6.1.1.4.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">by_reference_blank_out_ISINC</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_2" class="named-paragraph-link"><span class="named-paragraph">Inline annotation "by-reference-blank-out"</span><span class="named-paragraph-number">6.1.1.4.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">reference_exists_ISINC</span><span class="plain-syntax">)       </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_3" class="named-paragraph-link"><span class="named-paragraph">Inline annotation "reference-exists"</span><span class="named-paragraph-number">6.1.1.4.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">lvalue_by_reference_ISINC</span><span class="plain-syntax">)    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_4" class="named-paragraph-link"><span class="named-paragraph">Inline annotation "lvalue-by-reference"</span><span class="named-paragraph-number">6.1.1.4.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">by_value_ISINC</span><span class="plain-syntax">)               </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_5" class="named-paragraph-link"><span class="named-paragraph">Inline annotation "by-value"</span><span class="named-paragraph-number">6.1.1.4.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">make_true_ISINC</span><span class="plain-syntax">)              </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_6" class="named-paragraph-link"><span class="named-paragraph">Inline annotation "make-true"</span><span class="named-paragraph-number">6.1.1.4.6</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">box_quotation_text_ISINC</span><span class="plain-syntax">)     </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_7" class="named-paragraph-link"><span class="named-paragraph">Inline annotation "box-quotation-text"</span><span class="named-paragraph-number">6.1.1.4.7</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">try_action_ISINC</span><span class="plain-syntax">)             </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_10" class="named-paragraph-link"><span class="named-paragraph">Inline annotation "try-action"</span><span class="named-paragraph-number">6.1.1.4.10</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">try_action_silently_ISINC</span><span class="plain-syntax">)    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_11" class="named-paragraph-link"><span class="named-paragraph">Inline annotation "try-action-silently"</span><span class="named-paragraph-number">6.1.1.4.11</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">return_value_ISINC</span><span class="plain-syntax">)           </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_8" class="named-paragraph-link"><span class="named-paragraph">Inline annotation "return-value"</span><span class="named-paragraph-number">6.1.1.4.8</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">return_value_from_rule_ISINC</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_9" class="named-paragraph-link"><span class="named-paragraph">Inline annotation "return-value-from-rule"</span><span class="named-paragraph-number">6.1.1.4.9</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">property_holds_block_value_ISINC</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_12" class="named-paragraph-link"><span class="named-paragraph">Inline annotation "property-holds-block-value"</span><span class="named-paragraph-number">6.1.1.4.12</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">mark_event_used_ISINC</span><span class="plain-syntax">)        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_13" class="named-paragraph-link"><span class="named-paragraph">Inline annotation "mark-event-used"</span><span class="named-paragraph-number">6.1.1.4.13</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">rtp_code_ISINC</span><span class="plain-syntax">)               </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_14" class="named-paragraph-link"><span class="named-paragraph">Inline annotation "rtp-code"</span><span class="named-paragraph-number">6.1.1.4.14</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">rtp_location_ISINC</span><span class="plain-syntax">)           </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_15" class="named-paragraph-link"><span class="named-paragraph">Inline annotation "rtp-location"</span><span class="named-paragraph-number">6.1.1.4.15</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">C</span><span class="plain-syntax"> != </span><span class="identifier-syntax">no_ISINC</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">valid_annotation</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_16" class="named-paragraph-link"><span class="named-paragraph">Throw a problem message for an invalid inline annotation</span><span class="named-paragraph-number">6.1.1.4.16</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1">&#167;6.1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_1" class="paragraph-anchor"></a><b>&#167;6.1.1.4.1. </b>This affects only block values. When it's used, the token accepts the pointer
to the block value directly, that is, not copying the data over to a fresh
copy and using that instead. This means a definition like:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">zap</span><span class="plain-syntax"> (</span><span class="identifier-syntax">L</span><span class="plain-syntax"> - </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">list</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">numbers</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">Zap</span><span class="plain-syntax">({-</span><span class="identifier-syntax">by</span><span class="plain-syntax">-</span><span class="identifier-syntax">reference</span><span class="plain-syntax">:</span><span class="identifier-syntax">L</span><span class="plain-syntax">}, </span><span class="constant-syntax">10</span><span class="plain-syntax">); -).</span>
</pre>
<p class="commentary">will call <span class="extract"><span class="extract-syntax">Zap</span></span> on the actual list supplied to it. If <span class="extract"><span class="extract-syntax">Zap</span></span> chooses to change
this list, the original will change.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline annotation "by-reference"</span><span class="named-paragraph-number">6.1.1.4.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">by_value_not_reference</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">valid_annotation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_2" class="paragraph-anchor"></a><b>&#167;6.1.1.4.2. </b>And, variedly:
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline annotation "by-reference-blank-out"</span><span class="named-paragraph-number">6.1.1.4.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="2-cl.html#SP2" class="function-link"><span class="function-syntax">CompileLvalues::compile_table_reference</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">VH</span><span class="plain-syntax">, </span><span class="identifier-syntax">supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">; </span><span class="comment-syntax"> that is, don't use the regular token compiler: we've done it ourselves</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_3" class="paragraph-anchor"></a><b>&#167;6.1.1.4.3. </b>And, variedly:
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline annotation "reference-exists"</span><span class="named-paragraph-number">6.1.1.4.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="2-cl.html#SP2" class="function-link"><span class="function-syntax">CompileLvalues::compile_table_reference</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">VH</span><span class="plain-syntax">, </span><span class="identifier-syntax">supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">; </span><span class="comment-syntax"> that is, don't use the regular token compiler: we've done it ourselves</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_4" class="paragraph-anchor"></a><b>&#167;6.1.1.4.4. </b>This is a variant which checks that the reference is to an lvalue, that is,
to something which can be changed. If this weren't done, then
<span class="extract"><span class="extract-syntax">remove 2 from {1, 2, 3}</span></span> would compile without problem messages, though it
would behave pretty oddly at run-time.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline annotation "lvalue-by-reference"</span><span class="named-paragraph-number">6.1.1.4.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">by_value_not_reference</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">valid_annotation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">require_to_be_lvalue</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_5" class="paragraph-anchor"></a><b>&#167;6.1.1.4.5. </b>This is the default, so it's redundant, but clarifies definitions.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline annotation "by-value"</span><span class="named-paragraph-number">6.1.1.4.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">by_value_not_reference</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">valid_annotation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_6" class="paragraph-anchor"></a><b>&#167;6.1.1.4.6. </b>The one token of a "now" is a condition, but must be compiled in a special
way to make it come true rather than to test it.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline annotation "make-true"</span><span class="named-paragraph-number">6.1.1.4.6</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">XW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="5-cbal.html#SP5" class="function-link"><span class="function-syntax">CompileBlocksAndLines::compile_a_now</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">XW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">; </span><span class="comment-syntax"> that is, don't use the regular token compiler: we've done it ourselves</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_7" class="paragraph-anchor"></a><b>&#167;6.1.1.4.7. </b>This is used only for compiling down to the <span class="extract"><span class="extract-syntax">box</span></span> statement in I6, which has
slightly different textual requirements than regular text. We could get rid of
this by making a kind for box-quotation-text, and casting regular text to it,
but honestly having this annotation seems the smaller of the two warts.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline annotation "box-quotation-text"</span><span class="named-paragraph-number">6.1.1.4.7</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Rvalues::is_CONSTANT_of_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_text</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_spec</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_Misboxed</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"I attempted to compile %1, but the text '%2' supplied to be a boxed "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"quotation wasn't a constant piece of text in double-quotes. I'm afraid "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"that's the only sort of text allowed here."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">value_holster</span><span class="plain-syntax"> </span><span class="identifier-syntax">VH</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Holsters::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">INTER_VAL_VHMODE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">BoxQuotations::new</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">VH</span><span class="plain-syntax">, </span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Holsters::unholster_to_code_val</span><span class="plain-syntax">(</span><span class="identifier-syntax">Emit::tree</span><span class="plain-syntax">(), &amp;</span><span class="identifier-syntax">VH</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">; </span><span class="comment-syntax"> that is, don't use the regular token compiler: we've done it ourselves</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_8" class="paragraph-anchor"></a><b>&#167;6.1.1.4.8. </b>Suppose we are invoking "decide on 102" from the Basic Inform inline definition
of "decide on ...", which is:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    (- </span><span class="reserved-syntax">return</span><span class="plain-syntax"> {-</span><span class="reserved-syntax">return</span><span class="plain-syntax">-</span><span class="identifier-syntax">value:something</span><span class="plain-syntax">}; -)</span>
</pre>
<p class="commentary">We clearly need to police this: if the phrase is deciding a number, we need to
object to <span class="extract"><span class="extract-syntax">decide on "fish fingers"</span></span>.
</p>

<p class="commentary">That's one purpose of this annotation: it checks the value to see if it's suitable
to be returned. But we also might have to cast the value, or check that it's valid
at run-time. For instance, in a phrase to decide a container, given <span class="extract"><span class="extract-syntax">decide on the item</span></span>
we may need to check "item" at run-time: at compile-time we know it's an object,
but not necessarily that it's a container.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline annotation "return-value"</span><span class="named-paragraph-number">6.1.1.4.8</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">returning_from_rule</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_8_1" class="named-paragraph-link"><span class="named-paragraph">Handle an inline return</span><span class="named-paragraph-number">6.1.1.4.8.1</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_9" class="paragraph-anchor"></a><b>&#167;6.1.1.4.9. </b>Exactly the same mechanism is needed for rules which produce a value, but the
problem messages are phrased differently if something goes wrong.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline annotation "return-value-from-rule"</span><span class="named-paragraph-number">6.1.1.4.9</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">returning_from_rule</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_8_1" class="named-paragraph-link"><span class="named-paragraph">Handle an inline return</span><span class="named-paragraph-number">6.1.1.4.8.1</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_8_1" class="paragraph-anchor"></a><b>&#167;6.1.1.4.8.1. </b>So here's the common code:
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Handle an inline return</span><span class="named-paragraph-number">6.1.1.4.8.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">kind_needed</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">returning_from_rule</span><span class="plain-syntax">) </span><span class="identifier-syntax">kind_needed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Rulebooks::kind_from_context</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">kind_needed</span><span class="plain-syntax"> = </span><a href="3-sf.html#SP7" class="function-link"><span class="function-syntax">Frames::get_kind_returned</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">kind_supplied</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">id_body</span><span class="plain-syntax"> *</span><span class="identifier-syntax">current_idb</span><span class="plain-syntax"> = </span><a href="3-fnc.html#SP4" class="function-link"><span class="function-syntax">Functions::defn_being_compiled</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">mor</span><span class="plain-syntax"> = </span><span class="identifier-syntax">IDTypeData::get_mor</span><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">current_idb</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">type_data</span><span class="plain-syntax">));</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">allow_me</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ALWAYS_MATCH</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">kind_needed</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Kinds::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">kind_needed</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_nil</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Kinds::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">kind_needed</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_void</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">allow_me</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Kinds::compatible</span><span class="plain-syntax">(</span><span class="identifier-syntax">kind_supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">kind_needed</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">mor</span><span class="plain-syntax"> == </span><span class="identifier-syntax">DECIDES_CONDITION_MOR</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Kinds::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">kind_supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_truth_state</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">allow_me</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ALWAYS_MATCH</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_8_1_1" class="named-paragraph-link"><span class="named-paragraph">Issue a problem for returning a value when none was asked</span><span class="named-paragraph-number">6.1.1.4.8.1.1</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">allow_me</span><span class="plain-syntax"> == </span><span class="identifier-syntax">ALWAYS_MATCH</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><a href="2-cv.html#SP5" class="function-link"><span class="function-syntax">CompileValues::to_fresh_code_val_of_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">kind_needed</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">allow_me</span><span class="plain-syntax"> == </span><span class="identifier-syntax">SOMETIMES_MATCH</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Kinds::Behaviour::is_object</span><span class="plain-syntax">(</span><span class="identifier-syntax">kind_needed</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::call</span><span class="plain-syntax">(</span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">CHECKKINDRETURNED_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><a href="2-cv.html#SP5" class="function-link"><span class="function-syntax">CompileValues::to_fresh_code_val_of_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">kind_needed</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">RTKindDeclarations::iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">kind_needed</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_8_1_2" class="named-paragraph-link"><span class="named-paragraph">Issue a problem for returning a value of the wrong kind</span><span class="named-paragraph-number">6.1.1.4.8.1.2</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">; </span><span class="comment-syntax"> that is, don't use the regular token compiler: we've done it ourselves</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4_8">&#167;6.1.1.4.8</a> and <a href="5-cii.html#SP6_1_1_4_9">&#167;6.1.1.4.9</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_8_1_1" class="paragraph-anchor"></a><b>&#167;6.1.1.4.8.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue a problem for returning a value when none was asked</span><span class="named-paragraph-number">6.1.1.4.8.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_kind_of</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">returning_from_rule</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_RuleNotAllowedOutcome</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"You wrote %1 as something to be a successful outcome of a rule, which "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"has the kind %2; but this is not a rule which is allowed to have a value "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"as its outcome."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_RedundantReturnKOV</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"You wrote %1 as the outcome of a phrase, %2, but in the definition of "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"something which was not a phrase to decide a value."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4_8_1">&#167;6.1.1.4.8.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_8_1_2" class="paragraph-anchor"></a><b>&#167;6.1.1.4.8.1.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue a problem for returning a value of the wrong kind</span><span class="named-paragraph-number">6.1.1.4.8.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">kind_supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(3, </span><span class="identifier-syntax">kind_needed</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">returning_from_rule</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_RuleOutcomeWrongKind</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"You wrote %1 as the outcome of a rule which produces a value, but this "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"was the wrong kind of value: %2 rather than %3."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_ReturnWrongKind</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"You wrote %1 as the outcome of a phrase to decide a value, but this was "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"the wrong kind of value: %2 rather than %3."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4_8_1">&#167;6.1.1.4.8.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_10" class="paragraph-anchor"></a><b>&#167;6.1.1.4.10. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline annotation "try-action"</span><span class="named-paragraph-number">6.1.1.4.10</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Rvalues::is_CONSTANT_of_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_stored_action</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">explicit_action</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ea</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_constant_explicit_action</span><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="5-cii.html#SP9" class="function-link"><span class="function-syntax">CSIInline::compile_try_action</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ea</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::call</span><span class="plain-syntax">(</span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">STORED_ACTION_TY_TRY_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><a href="2-cv.html#SP5" class="function-link"><span class="function-syntax">CompileValues::to_code_val_of_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_stored_action</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">valid_annotation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">; </span><span class="comment-syntax"> that is, don't use the regular token compiler: we've done it ourselves</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_11" class="paragraph-anchor"></a><b>&#167;6.1.1.4.11. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline annotation "try-action-silently"</span><span class="named-paragraph-number">6.1.1.4.11</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Rvalues::is_CONSTANT_of_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_stored_action</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">explicit_action</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ea</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_constant_explicit_action</span><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="5-cii.html#SP9" class="function-link"><span class="function-syntax">CSIInline::compile_try_action</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ea</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::call</span><span class="plain-syntax">(</span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">STORED_ACTION_TY_TRY_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><a href="2-cv.html#SP5" class="function-link"><span class="function-syntax">CompileValues::to_code_val_of_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_stored_action</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::val_true</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">valid_annotation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">; </span><span class="comment-syntax"> that is, don't use the regular token compiler: we've done it ourselves</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_12" class="paragraph-anchor"></a><b>&#167;6.1.1.4.12. </b>Suppose we have a token which is a property name, and we want to know about the
kind of value the property holds. We can't simply take the kind of the token, because
that would be "property name". Instead:
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline annotation "property-holds-block-value"</span><span class="named-paragraph-number">6.1.1.4.12</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">property</span><span class="plain-syntax"> *</span><span class="identifier-syntax">prn</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Rvalues::to_property</span><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">prn</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">Properties::is_either_or</span><span class="plain-syntax">(</span><span class="identifier-syntax">prn</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::val_false</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ValueProperties::kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">prn</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Behaviour::uses_block_values</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::val_true</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::val_false</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">; </span><span class="comment-syntax"> that is, don't use the regular token compiler: we've done it ourselves</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_13" class="paragraph-anchor"></a><b>&#167;6.1.1.4.13. </b>This little annotation is used in <a href="../if-module/3-tr.html" class="internal">Timed Rules (in if)</a>.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline annotation "mark-event-used"</span><span class="named-paragraph-number">6.1.1.4.13</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::nonstandard_inline_annotation</span><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">inline_command</span><span class="plain-syntax">, </span><span class="identifier-syntax">supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">valid_annotation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_14" class="paragraph-anchor"></a><b>&#167;6.1.1.4.14. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline annotation "rtp-code"</span><span class="named-paragraph-number">6.1.1.4.14</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Rvalues::is_CONSTANT_of_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_text</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_14_1" class="named-paragraph-link"><span class="named-paragraph">Throw PM_NonConstantRTPCode</span><span class="named-paragraph-number">6.1.1.4.14.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">SW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wordings::length</span><span class="plain-syntax">(</span><span class="identifier-syntax">SW</span><span class="plain-syntax">) == </span><span class="constant-syntax">1</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">w1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Wordings::first_wn</span><span class="plain-syntax">(</span><span class="identifier-syntax">SW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">inform_extension</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Extensions::corresponding_to</span><span class="plain-syntax">(</span><span class="identifier-syntax">Lexer::file_of_origin</span><span class="plain-syntax">(</span><span class="identifier-syntax">w1</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">E</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">E</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">as_copy</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">location_if_path</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">))</span>
<span class="plain-syntax">                </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_14_3" class="named-paragraph-link"><span class="named-paragraph">Throw PM_RTPOnlyInExtensions</span><span class="named-paragraph-number">6.1.1.4.14.3</span></a></span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Lexer::word_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">w1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcode</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (; *</span><span class="identifier-syntax">p</span><span class="plain-syntax">; </span><span class="identifier-syntax">p</span><span class="plain-syntax">++) </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (*</span><span class="identifier-syntax">p</span><span class="plain-syntax"> != </span><span class="character-syntax">'"'</span><span class="plain-syntax">) </span><span class="identifier-syntax">PUT_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcode</span><span class="plain-syntax">, *</span><span class="identifier-syntax">p</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">EmitCode::val_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcode</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">pathname</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Pathnames::down</span><span class="plain-syntax">(</span><span class="identifier-syntax">E</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">as_copy</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">location_if_path</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"RTPs"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcode</span><span class="plain-syntax">, </span><span class="string-syntax">".md"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">F</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Filenames::in</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">pcode</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">TextFiles::exists</span><span class="plain-syntax">(</span><span class="identifier-syntax">F</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">"Looked for RTP text at: %f\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">F</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_14_2" class="named-paragraph-link"><span class="named-paragraph">Throw PM_UnrecognisedRTPCode</span><span class="named-paragraph-number">6.1.1.4.14.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">                }</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcode</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_14_2" class="named-paragraph-link"><span class="named-paragraph">Throw PM_UnrecognisedRTPCode</span><span class="named-paragraph-number">6.1.1.4.14.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">; </span><span class="comment-syntax"> that is, don't use the regular token compiler: we've done it ourselves</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_15" class="paragraph-anchor"></a><b>&#167;6.1.1.4.15. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline annotation "rtp-location"</span><span class="named-paragraph-number">6.1.1.4.15</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Rvalues::is_CONSTANT_of_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_text</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_14_1" class="named-paragraph-link"><span class="named-paragraph">Throw PM_NonConstantRTPCode</span><span class="named-paragraph-number">6.1.1.4.14.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">SW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wordings::length</span><span class="plain-syntax">(</span><span class="identifier-syntax">SW</span><span class="plain-syntax">) == </span><span class="constant-syntax">1</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">w1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Wordings::first_wn</span><span class="plain-syntax">(</span><span class="identifier-syntax">SW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">inform_extension</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Extensions::corresponding_to</span><span class="plain-syntax">(</span><span class="identifier-syntax">Lexer::file_of_origin</span><span class="plain-syntax">(</span><span class="identifier-syntax">w1</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">E</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">E</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">as_copy</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">location_if_path</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">))</span>
<span class="plain-syntax">                </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_14_3" class="named-paragraph-link"><span class="named-paragraph">Throw PM_RTPOnlyInExtensions</span><span class="named-paragraph-number">6.1.1.4.14.3</span></a></span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Lexer::word_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">w1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcode</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (; *</span><span class="identifier-syntax">p</span><span class="plain-syntax">; </span><span class="identifier-syntax">p</span><span class="plain-syntax">++) </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (*</span><span class="identifier-syntax">p</span><span class="plain-syntax"> != </span><span class="character-syntax">'"'</span><span class="plain-syntax">) </span><span class="identifier-syntax">PUT_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcode</span><span class="plain-syntax">, *</span><span class="identifier-syntax">p</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">pathname</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Pathnames::down</span><span class="plain-syntax">(</span><span class="identifier-syntax">E</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">as_copy</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">location_if_path</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"RTPs"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcode</span><span class="plain-syntax">, </span><span class="string-syntax">".md"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">F</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Filenames::in</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">pcode</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">TextFiles::exists</span><span class="plain-syntax">(</span><span class="identifier-syntax">F</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">"Looked for RTP text at: %f\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">F</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_14_2" class="named-paragraph-link"><span class="named-paragraph">Throw PM_UnrecognisedRTPCode</span><span class="named-paragraph-number">6.1.1.4.14.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">                } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">Str::clear</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcode</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">CompletionModule::write_RTP_path</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcode</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">EmitCode::val_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcode</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                }</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcode</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_1_1_4_14_2" class="named-paragraph-link"><span class="named-paragraph">Throw PM_UnrecognisedRTPCode</span><span class="named-paragraph-number">6.1.1.4.14.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">; </span><span class="comment-syntax"> that is, don't use the regular token compiler: we've done it ourselves</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_14_1" class="paragraph-anchor"></a><b>&#167;6.1.1.4.14.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Throw PM_NonConstantRTPCode</span><span class="named-paragraph-number">6.1.1.4.14.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_spec</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_NonConstantRTPCode</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="string-syntax">"In %1, a run-time problem must be identified by a literal code in double-quotation "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"marks: other forms of text, such as '%2', do not count."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4_14">&#167;6.1.1.4.14</a> and <a href="5-cii.html#SP6_1_1_4_15">&#167;6.1.1.4.15</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_14_2" class="paragraph-anchor"></a><b>&#167;6.1.1.4.14.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Throw PM_UnrecognisedRTPCode</span><span class="named-paragraph-number">6.1.1.4.14.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_spec</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_UnrecognisedRTPCode</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="string-syntax">"In %1, a run-time problem must be identified by a literal code in double-quotation "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"marks: but '%2' does not seem to be one of the RTPs for the current extension."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4_14">&#167;6.1.1.4.14</a> (twice) and <a href="5-cii.html#SP6_1_1_4_15">&#167;6.1.1.4.15</a> (twice).</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_14_3" class="paragraph-anchor"></a><b>&#167;6.1.1.4.14.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Throw PM_RTPOnlyInExtensions</span><span class="named-paragraph-number">6.1.1.4.14.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_spec</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">supplied</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_RTPOnlyInExtensions</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="string-syntax">"You wrote %1, but run-time problems can only be issued from extensions which "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"are stored in directory form, not from the main source text of a project or "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"from an extension stored in a single .i7x file."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4_14">&#167;6.1.1.4.14</a> and <a href="5-cii.html#SP6_1_1_4_15">&#167;6.1.1.4.15</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_1_1_4_16" class="paragraph-anchor"></a><b>&#167;6.1.1.4.16. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Throw a problem message for an invalid inline annotation</span><span class="named-paragraph-number">6.1.1.4.16</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_stream</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">command</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_BadInlineTag</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="string-syntax">"I attempted to compile %1 using its inline definition, but this contained the "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"invalid annotation '%2'."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_1_1_4">&#167;6.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. Try and try silently.</b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">CSIInline::compile_try_action</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">CSIInline::compile_try_action</span></span>:<br/><a href="5-cii.html#SP6_1_1_4_10">&#167;6.1.1.4.10</a>, <a href="5-cii.html#SP6_1_1_4_11">&#167;6.1.1.4.11</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">explicit_action</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ea</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">silently</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">silently</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">PUSH_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">KEEP_SILENT_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">STORE_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::ref_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">KEEP_SILENT_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::val_number</span><span class="plain-syntax">(1);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">PUSH_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">SAY__P_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">PUSH_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">SAY__PC_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::call</span><span class="plain-syntax">(</span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">CLEARPARAGRAPHING_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::val_true</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><a href="2-cr.html#SP5" class="function-link"><span class="function-syntax">CompileRvalues::compile_explicit_action</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ea</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">silently</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::call</span><span class="plain-syntax">(</span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">DIVIDEPARAGRAPHPOINT_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">PULL_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::ref_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">SAY__PC_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">PULL_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::ref_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">SAY__P_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::call</span><span class="plain-syntax">(</span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">ADJUSTPARAGRAPHPOINT_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">PULL_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::ref_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">KEEP_SILENT_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6_2" class="paragraph-anchor"></a><b>&#167;6.2. Commands about kinds.</b>And that's it for the general machinery, but in another sense we're only just
getting started. We now go through all of the special syntaxes which make
invocation-language so baroque.
</p>

<p class="commentary">We'll start with a suite of details about kinds:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    {-</span><span class="identifier-syntax">command:kind</span><span class="plain-syntax"> </span><span class="identifier-syntax">name</span><span class="plain-syntax">}</span>
</pre>
<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Expand a bracing containing a kind command</span><span class="named-paragraph-number">6.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_stream</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">new_ISINC</span><span class="plain-syntax">)              </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_1" class="named-paragraph-link"><span class="named-paragraph">Inline command "new"</span><span class="named-paragraph-number">6.2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">new_list_of_ISINC</span><span class="plain-syntax">)      </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_2" class="named-paragraph-link"><span class="named-paragraph">Inline command "new-list-of"</span><span class="named-paragraph-number">6.2.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">printing_routine_ISINC</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_5" class="named-paragraph-link"><span class="named-paragraph">Inline command "printing-routine"</span><span class="named-paragraph-number">6.2.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">ranger_routine_ISINC</span><span class="plain-syntax">)   </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_6" class="named-paragraph-link"><span class="named-paragraph">Inline command "ranger-routine"</span><span class="named-paragraph-number">6.2.6</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">indexing_routine_ISINC</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_7" class="named-paragraph-link"><span class="named-paragraph">Inline command "indexing-routine"</span><span class="named-paragraph-number">6.2.7</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">next_routine_ISINC</span><span class="plain-syntax">)     </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_3" class="named-paragraph-link"><span class="named-paragraph">Inline command "next-routine"</span><span class="named-paragraph-number">6.2.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">previous_routine_ISINC</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_4" class="named-paragraph-link"><span class="named-paragraph">Inline command "previous-routine"</span><span class="named-paragraph-number">6.2.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">strong_kind_ISINC</span><span class="plain-syntax">)      </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_8" class="named-paragraph-link"><span class="named-paragraph">Inline command "strong-kind"</span><span class="named-paragraph-number">6.2.8</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">weak_kind_ISINC</span><span class="plain-syntax">)        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_9" class="named-paragraph-link"><span class="named-paragraph">Inline command "weak-kind"</span><span class="named-paragraph-number">6.2.9</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">object_kind_ISINC</span><span class="plain-syntax">)      </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_10" class="named-paragraph-link"><span class="named-paragraph">Inline command "object-kind"</span><span class="named-paragraph-number">6.2.10</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_2_1" class="paragraph-anchor"></a><b>&#167;6.2.1. </b>The following produces a new value of the given kind. If it's stored as a
word value, this will just be the default value, so <span class="extract"><span class="extract-syntax">{-new:time}</span></span> will output
540, that being the Inform 6 representation of 9:00 AM. If it's a block value,
we compile code which creates a new value stored on the heap. This comes into
its own when kind variables are in play.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "new"</span><span class="named-paragraph-number">6.2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP11" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Behaviour::uses_block_values</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">)) </span><a href="3-sf.html#SP21" class="function-link"><span class="function-syntax">Frames::emit_new_local_value</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_1_2" class="named-paragraph-link"><span class="named-paragraph">Issue an inline no-such-kind problem</span><span class="named-paragraph-number">6.2.1.2</span></a></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">DefaultValues::val</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_1_1" class="named-paragraph-link"><span class="named-paragraph">Issue problem for no natural choice</span><span class="named-paragraph-number">6.2.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_2">&#167;6.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_2_1_1" class="paragraph-anchor"></a><b>&#167;6.2.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue problem for no natural choice</span><span class="named-paragraph-number">6.2.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_NoNaturalDefault2</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="string-syntax">"To achieve %1, we'd need to be able to store a default value of the kind '%2', "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"but there's no natural choice for this."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_2_1">&#167;6.2.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_2_2" class="paragraph-anchor"></a><b>&#167;6.2.2. </b>The following complication makes lists of a given description. The inline
definition:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">LIST_OF_TY_Desc</span><span class="plain-syntax">({-</span><span class="identifier-syntax">new:list</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">K</span><span class="plain-syntax">}, {</span><span class="identifier-syntax">D</span><span class="plain-syntax">}, {-</span><span class="identifier-syntax">strong</span><span class="plain-syntax">-</span><span class="identifier-syntax">kind:K</span><span class="plain-syntax">})</span>
</pre>
<p class="commentary">is not good enough, because it fails if the description D makes reference to
local variables (as it well may); instead we must construe D as a deferred
proposition.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "new-list-of"</span><span class="named-paragraph-number">6.2.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP11" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><a href="4-cp.html#SP6" class="function-link"><span class="function-syntax">CompilePropositions::to_list_of_matches</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[0], </span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_2">&#167;6.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_2_3" class="paragraph-anchor"></a><b>&#167;6.2.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "next-routine"</span><span class="named-paragraph-number">6.2.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP11" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax">) </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">RTKindConstructors::increment_fn_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_1_2" class="named-paragraph-link"><span class="named-paragraph">Issue an inline no-such-kind problem</span><span class="named-paragraph-number">6.2.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_2">&#167;6.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_2_4" class="paragraph-anchor"></a><b>&#167;6.2.4. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "previous-routine"</span><span class="named-paragraph-number">6.2.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP11" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax">) </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">RTKindConstructors::decrement_fn_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_1_2" class="named-paragraph-link"><span class="named-paragraph">Issue an inline no-such-kind problem</span><span class="named-paragraph-number">6.2.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_2">&#167;6.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_2_5" class="paragraph-anchor"></a><b>&#167;6.2.5. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "printing-routine"</span><span class="named-paragraph-number">6.2.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP11" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax">) </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">RTKindConstructors::printing_fn_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_1_2" class="named-paragraph-link"><span class="named-paragraph">Issue an inline no-such-kind problem</span><span class="named-paragraph-number">6.2.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_2">&#167;6.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_2_6" class="paragraph-anchor"></a><b>&#167;6.2.6. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "ranger-routine"</span><span class="named-paragraph-number">6.2.6</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP11" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Kinds::Behaviour::is_built_in</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">)) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Kinds::Behaviour::is_quasinumerical</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">GENERATERANDOMNUMBER_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax">) </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">RTKindConstructors::random_value_fn_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_1_2" class="named-paragraph-link"><span class="named-paragraph">Issue an inline no-such-kind problem</span><span class="named-paragraph-number">6.2.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_2">&#167;6.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_2_7" class="paragraph-anchor"></a><b>&#167;6.2.7. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "indexing-routine"</span><span class="named-paragraph-number">6.2.7</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP11" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax">) </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">RTKindConstructors::indexing_fn_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_1_2" class="named-paragraph-link"><span class="named-paragraph">Issue an inline no-such-kind problem</span><span class="named-paragraph-number">6.2.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_2">&#167;6.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_2_8" class="paragraph-anchor"></a><b>&#167;6.2.8. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "strong-kind"</span><span class="named-paragraph-number">6.2.8</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP11" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax">) </span><span class="identifier-syntax">RTKindIDs::emit_strong_ID_as_val</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_1_2" class="named-paragraph-link"><span class="named-paragraph">Issue an inline no-such-kind problem</span><span class="named-paragraph-number">6.2.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_2">&#167;6.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_2_9" class="paragraph-anchor"></a><b>&#167;6.2.9. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "weak-kind"</span><span class="named-paragraph-number">6.2.9</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP11" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax">) </span><span class="identifier-syntax">RTKindIDs::emit_weak_ID_as_val</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_1_2" class="named-paragraph-link"><span class="named-paragraph">Issue an inline no-such-kind problem</span><span class="named-paragraph-number">6.2.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_2">&#167;6.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_2_10" class="paragraph-anchor"></a><b>&#167;6.2.10. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "object-kind"</span><span class="named-paragraph-number">6.2.10</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP11" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Behaviour::is_object</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">RTKindDeclarations::iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::val_number</span><span class="plain-syntax">(0);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_1_2" class="named-paragraph-link"><span class="named-paragraph">Issue an inline no-such-kind problem</span><span class="named-paragraph-number">6.2.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_2">&#167;6.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_2_1_2" class="paragraph-anchor"></a><b>&#167;6.2.1.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue an inline no-such-kind problem</span><span class="named-paragraph-number">6.2.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::inline_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_InlineNew</span><span class="plain-syntax">), </span><span class="identifier-syntax">idb</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">owner</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">parent_schema</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">converted_from</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"I don't know any kind called '%4'."</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_2_1">&#167;6.2.1</a>, <a href="5-cii.html#SP6_2_3">&#167;6.2.3</a>, <a href="5-cii.html#SP6_2_4">&#167;6.2.4</a>, <a href="5-cii.html#SP6_2_5">&#167;6.2.5</a>, <a href="5-cii.html#SP6_2_6">&#167;6.2.6</a>, <a href="5-cii.html#SP6_2_7">&#167;6.2.7</a>, <a href="5-cii.html#SP6_2_8">&#167;6.2.8</a>, <a href="5-cii.html#SP6_2_9">&#167;6.2.9</a>, <a href="5-cii.html#SP6_2_10">&#167;6.2.10</a> and <a href="5-cii.html#SP6_5_10">&#167;6.5.10</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_3" class="paragraph-anchor"></a><b>&#167;6.3. Typographic commands.</b>These rather clumsy commands are a residue from earlier forms of the markup
language, really. <span class="extract"><span class="extract-syntax">{-open-brace}</span></span> and <span class="extract"><span class="extract-syntax">{-close-brace}</span></span> are handled for us
elsewhere, so we need do nothing. The other two have actually been withdrawn.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Expand a bracing containing a typographic command</span><span class="named-paragraph-number">6.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">backspace_ISINC</span><span class="plain-syntax">)   </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_3_1" class="named-paragraph-link"><span class="named-paragraph">Inline command "backspace"</span><span class="named-paragraph-number">6.3.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">erase_ISINC</span><span class="plain-syntax">)       </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_3_2" class="named-paragraph-link"><span class="named-paragraph">Inline command "erase"</span><span class="named-paragraph-number">6.3.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">open_brace_ISINC</span><span class="plain-syntax">)  </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">close_brace_ISINC</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_3_1" class="paragraph-anchor"></a><b>&#167;6.3.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "backspace"</span><span class="named-paragraph-number">6.3.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_BackspaceWithdrawn</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="string-syntax">"I attempted to compile %1 using its inline definition, but this contained the "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"invalid annotation '{backspace}', which has been withdrawn. (Inline annotations "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"are no longer allowed to amend the compilation stream to their left.)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_3">&#167;6.3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_3_2" class="paragraph-anchor"></a><b>&#167;6.3.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "erase"</span><span class="named-paragraph-number">6.3.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_EraseWithdrawn</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="string-syntax">"I attempted to compile %1 using its inline definition, but this contained the "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"invalid annotation '{erase}', which has been withdrawn. (Inline annotations "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"are no longer allowed to blank out the compilation stream.)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_3">&#167;6.3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_4" class="paragraph-anchor"></a><b>&#167;6.4. Label or counter commands.</b>Here we want to generate unique numbers, or uniquely named labels, on demand.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Expand a bracing containing a label or counter command</span><span class="named-paragraph-number">6.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">label_ISINC</span><span class="plain-syntax">)               </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_4_1" class="named-paragraph-link"><span class="named-paragraph">Inline command "label"</span><span class="named-paragraph-number">6.4.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">counter_ISINC</span><span class="plain-syntax">)             </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_4_2" class="named-paragraph-link"><span class="named-paragraph">Inline command "counter"</span><span class="named-paragraph-number">6.4.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">counter_storage_ISINC</span><span class="plain-syntax">)     </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_4_3" class="named-paragraph-link"><span class="named-paragraph">Inline command "counter-storage"</span><span class="named-paragraph-number">6.4.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">counter_up_ISINC</span><span class="plain-syntax">)          </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_4_4" class="named-paragraph-link"><span class="named-paragraph">Inline command "counter-up"</span><span class="named-paragraph-number">6.4.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">counter_down_ISINC</span><span class="plain-syntax">)        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_4_5" class="named-paragraph-link"><span class="named-paragraph">Inline command "counter-down"</span><span class="named-paragraph-number">6.4.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">counter_makes_array_ISINC</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_4_6" class="named-paragraph-link"><span class="named-paragraph">Inline command "counter-makes-array"</span><span class="named-paragraph-number">6.4.6</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_4_1" class="paragraph-anchor"></a><b>&#167;6.4.1. </b>We can have any number of sets of labels, each with its own base name,
which should be supplied as the argument. For example:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    {-</span><span class="identifier-syntax">label:pineapple</span><span class="plain-syntax">}</span>
</pre>
<p class="commentary">generates the current label in the "pineapple" set. (Sets don't need to be
declared: they can be mentioned the first time they are used.) These label
names take the form <span class="extract"><span class="extract-syntax">L_pineapple_0</span></span>, <span class="extract"><span class="extract-syntax">L_pineapple_1</span></span>, and so on; each named
set has its own counter (0, 1, 2, ...). So this inline definition works
safely:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">jump</span><span class="plain-syntax"> {-</span><span class="identifier-syntax">label:leap</span><span class="plain-syntax">}; </span><span class="identifier-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"Yikes! A trap!"</span><span class="plain-syntax">; .{-</span><span class="identifier-syntax">label:leap</span><span class="plain-syntax">}{-</span><span class="identifier-syntax">counter</span><span class="plain-syntax">-</span><span class="identifier-syntax">up:leap</span><span class="plain-syntax">};</span>
</pre>
<p class="commentary">if a little pointlessly, generating first
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">jump</span><span class="plain-syntax"> </span><span class="identifier-syntax">L_leap_0</span><span class="plain-syntax">; </span><span class="identifier-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"Yikes! A trap!"</span><span class="plain-syntax">; .</span><span class="identifier-syntax">L_leap_0</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary">and then
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">jump</span><span class="plain-syntax"> </span><span class="identifier-syntax">L_leap_1</span><span class="plain-syntax">; </span><span class="identifier-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"Yikes! A trap!"</span><span class="plain-syntax">; .</span><span class="identifier-syntax">L_leap_1</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary">and so on. The point of this is that it guarantees we won't define two labels
with identical names in the same Inform 6 routine, which would fail to compile.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "label"</span><span class="named-paragraph-number">6.4.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">arg_L</span><span class="plain-syntax"> != </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><a href="3-jl.html#SP2" class="function-link"><span class="function-syntax">JumpLabels::write</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">arg_L</span><span class="plain-syntax">, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">L</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">L</span><span class="plain-syntax">, </span><span class="string-syntax">"."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="3-jl.html#SP2" class="function-link"><span class="function-syntax">JumpLabels::write</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">L</span><span class="plain-syntax">, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::lab</span><span class="plain-syntax">(</span><span class="identifier-syntax">EmitCode::reserve_label</span><span class="plain-syntax">(</span><span class="identifier-syntax">L</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">L</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_4">&#167;6.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_4_2" class="paragraph-anchor"></a><b>&#167;6.4.2. </b>We can also output just the numerical counter:
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "counter"</span><span class="named-paragraph-number">6.4.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::val_number</span><span class="plain-syntax">((</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><a href="3-jl.html#SP5" class="function-link"><span class="function-syntax">JumpLabels::read_counter</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_4">&#167;6.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_4_3" class="paragraph-anchor"></a><b>&#167;6.4.3. </b>We can also output just the storage array:
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "counter-storage"</span><span class="named-paragraph-number">6.4.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><a href="3-jl.html#SP6" class="function-link"><span class="function-syntax">JumpLabels::storage_iname</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_4">&#167;6.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_4_4" class="paragraph-anchor"></a><b>&#167;6.4.4. </b>Or increment it, printing nothing:
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "counter-up"</span><span class="named-paragraph-number">6.4.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="3-jl.html#SP5" class="function-link"><span class="function-syntax">JumpLabels::read_counter</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_4">&#167;6.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_4_5" class="paragraph-anchor"></a><b>&#167;6.4.5. </b>Or decrement it. (Careful, though: if it decrements below zero, an enigmatic
internal error will halt Inform.)
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "counter-down"</span><span class="named-paragraph-number">6.4.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="3-jl.html#SP5" class="function-link"><span class="function-syntax">JumpLabels::read_counter</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, -1);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_4">&#167;6.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_4_6" class="paragraph-anchor"></a><b>&#167;6.4.6. </b>We can use counters for anything, not just to generate labels, and one
useful trick is to allocate storage at run-time. Invoking
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    {-</span><span class="identifier-syntax">counter</span><span class="plain-syntax">-</span><span class="identifier-syntax">makes</span><span class="plain-syntax">-</span><span class="identifier-syntax">array:pineapple</span><span class="plain-syntax">}</span>
</pre>
<p class="commentary">at any time during compilation (once or many times over, it makes no
difference) causes Inform to generate an array called <span class="extract"><span class="extract-syntax">I7_ST_pineapple</span></span>
guaranteed to contain one entry for each counter value reached. Thus:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">remember</span><span class="plain-syntax"> (</span><span class="identifier-syntax">N</span><span class="plain-syntax"> - </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax">) </span><span class="identifier-syntax">for</span><span class="plain-syntax"> </span><span class="identifier-syntax">later</span><span class="plain-syntax">: ...</span>
</pre>
<p class="commentary">might be defined inline as
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    {-</span><span class="identifier-syntax">counter</span><span class="plain-syntax">-</span><span class="identifier-syntax">makes</span><span class="plain-syntax">-</span><span class="identifier-syntax">array:pineapple</span><span class="plain-syntax">}</span><span class="identifier-syntax">I7_ST_pineapple</span><span class="plain-syntax">--&gt;{-</span><span class="identifier-syntax">counter:pineapple</span><span class="plain-syntax">} = {</span><span class="identifier-syntax">N</span><span class="plain-syntax">};</span>
</pre>
<p class="commentary">and the effect will be to accumulate an array of numbers during compilation.
Note that the value of a counter can also be read in template language,
so with a little care we can get the final extent of the array, too. If more
than one word of storage per count is needed, try:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    {-</span><span class="identifier-syntax">counter</span><span class="plain-syntax">-</span><span class="identifier-syntax">makes</span><span class="plain-syntax">-</span><span class="identifier-syntax">array:pineapple:3</span><span class="plain-syntax">}</span>
</pre>
<p class="commentary">or similar &mdash; this ensures that the array contains not fewer than three times
as many cells as the final value of the count. (If multiple invocations are
made with different numbers here, the maximum is taken.)
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "counter-makes-array"</span><span class="named-paragraph-number">6.4.6</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">words_per_count</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">words_per_count</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::atoi</span><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-jl.html#SP6" class="function-link"><span class="function-syntax">JumpLabels::allocate_storage</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="identifier-syntax">words_per_count</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_4">&#167;6.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5" class="paragraph-anchor"></a><b>&#167;6.5. High-level commands.</b>This category is intended for powerful and flexible commands, allowing for
invocations which behave like control statements in other languages. (See
also <span class="extract"><span class="extract-syntax">{-block}</span></span> above, though that is syntactically a divider rather than
a command, which is why it isn't here.)
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Expand a bracing containing a high-level command</span><span class="named-paragraph-number">6.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">my_ISINC</span><span class="plain-syntax">)                      </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_1" class="named-paragraph-link"><span class="named-paragraph">Inline command "my"</span><span class="named-paragraph-number">6.5.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">unprotect_ISINC</span><span class="plain-syntax">)               </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_2" class="named-paragraph-link"><span class="named-paragraph">Inline command "unprotect"</span><span class="named-paragraph-number">6.5.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">copy_ISINC</span><span class="plain-syntax">)                    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_4" class="named-paragraph-link"><span class="named-paragraph">Inline command "copy"</span><span class="named-paragraph-number">6.5.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">initialise_ISINC</span><span class="plain-syntax">)              </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_3" class="named-paragraph-link"><span class="named-paragraph">Inline command "initialise"</span><span class="named-paragraph-number">6.5.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">match_right_relation_domain_ISINC</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_6" class="named-paragraph-link"><span class="named-paragraph">Inline command "match-right-relation-domain"</span><span class="named-paragraph-number">6.5.6</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">match_left_relation_domain_ISINC</span><span class="plain-syntax">)  </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_5" class="named-paragraph-link"><span class="named-paragraph">Inline command "match-left-relation-domain"</span><span class="named-paragraph-number">6.5.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">matches_description_ISINC</span><span class="plain-syntax">)     </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_7" class="named-paragraph-link"><span class="named-paragraph">Inline command "matches-description"</span><span class="named-paragraph-number">6.5.7</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">now_matches_description_ISINC</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_8" class="named-paragraph-link"><span class="named-paragraph">Inline command "now-matches-description"</span><span class="named-paragraph-number">6.5.8</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">arithmetic_operation_ISINC</span><span class="plain-syntax">)    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_9" class="named-paragraph-link"><span class="named-paragraph">Inline command "arithmetic-operation"</span><span class="named-paragraph-number">6.5.9</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">say_ISINC</span><span class="plain-syntax">)                     </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_10" class="named-paragraph-link"><span class="named-paragraph">Inline command "say"</span><span class="named-paragraph-number">6.5.10</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">show_me_ISINC</span><span class="plain-syntax">)                 </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_11" class="named-paragraph-link"><span class="named-paragraph">Inline command "show-me"</span><span class="named-paragraph-number">6.5.11</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_1" class="paragraph-anchor"></a><b>&#167;6.5.1. </b>The <span class="extract"><span class="extract-syntax">{-my:name}</span></span> command creates a local variable for use in the invocation,
and then prints the variable's name. (If the same variable is created twice,
the second time it's simply printed.)
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "my"</span><span class="named-paragraph-number">6.5.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">local_variable</span><span class="plain-syntax"> *</span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">n</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">int</span><span class="plain-syntax">) (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">) - </span><span class="character-syntax">'0'</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">n</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">n</span><span class="plain-syntax"> &lt; </span><span class="constant-syntax">10</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_1_1" class="named-paragraph-link"><span class="named-paragraph">A single digit as the name</span><span class="named-paragraph-number">6.5.1.1</span></a></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_1_2" class="named-paragraph-link"><span class="named-paragraph">An Inter identifier as the name</span><span class="named-paragraph-number">6.5.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">lvar_s</span><span class="plain-syntax"> = </span><a href="3-lv.html#SP1" class="function-link"><span class="function-syntax">LocalVariables::declare</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">prim_cat</span><span class="plain-syntax"> == </span><span class="identifier-syntax">REF_PRIM_CAT</span><span class="plain-syntax">) </span><span class="identifier-syntax">EmitCode::ref_symbol</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">lvar_s</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">EmitCode::val_symbol</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">lvar_s</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5">&#167;6.5</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_1_1" class="paragraph-anchor"></a><b>&#167;6.5.1.1. </b>In the first form, we don't give an explicit name, but simply a digit from
0 to 9. We're therefore allowed to create up to 10 variables this way, and
the ones we create will be different from those made by any other invocation
(including other invocations of the same phrase). See above.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">A single digit as the name</span><span class="named-paragraph-number">6.5.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> = </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">[</span><span class="identifier-syntax">n</span><span class="plain-syntax">];</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">[</span><span class="identifier-syntax">n</span><span class="plain-syntax">] = </span><a href="3-lv.html#SP7" class="function-link"><span class="function-syntax">LocalVariables::new_let_value</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_number</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> = </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">[</span><span class="identifier-syntax">n</span><span class="plain-syntax">];</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_1_1_1" class="named-paragraph-link"><span class="named-paragraph">Set the kind of the new variable</span><span class="named-paragraph-number">6.5.1.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">IDTypeData::block_follows</span><span class="plain-syntax">(</span><span class="identifier-syntax">idb</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><a href="3-cb.html#SP18" class="function-link"><span class="function-syntax">CodeBlocks::set_scope_to_block_about_to_open</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5_1">&#167;6.5.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_1_2" class="paragraph-anchor"></a><b>&#167;6.5.1.2. </b>The second form is simpler. <span class="extract"><span class="extract-syntax">{-my:1}</span></span> and such make locals with names like
<span class="extract"><span class="extract-syntax">tmp_3</span></span>, which we have no control over. Here we get to make a local with
exactly the name we want. This can't be reallocated, of course; it's there
throughout the routine, so there's no question of setting its scope. For example:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">be</span><span class="plain-syntax"> </span><span class="identifier-syntax">warned</span><span class="plain-syntax">:</span>
<span class="plain-syntax">    (- {-</span><span class="identifier-syntax">my</span><span class="plain-syntax">:</span><span class="identifier-syntax">warn</span><span class="plain-syntax">} = </span><span class="identifier-syntax">true</span><span class="plain-syntax">; -).</span>
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">if</span><span class="plain-syntax"> </span><span class="identifier-syntax">we</span><span class="plain-syntax"> </span><span class="identifier-syntax">have</span><span class="plain-syntax"> </span><span class="identifier-syntax">been</span><span class="plain-syntax"> </span><span class="identifier-syntax">warned</span><span class="plain-syntax">:</span>
<span class="plain-syntax">    (- ({-</span><span class="identifier-syntax">my</span><span class="plain-syntax">:</span><span class="identifier-syntax">warn</span><span class="plain-syntax">}) -).</span>
</pre>
<p class="commentary">The net result here is that if either phrase is used, then <span class="extract"><span class="extract-syntax">warn</span></span> becomes a
local variable. The second phrase tests if the first has been used.
</p>

<p class="commentary">Nothing, of course, stops some other invocation from using a variable of
the same name for some quite different purpose, wreaking havoc. This is
why the numbered scheme above is mostly better.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">An Inter identifier as the name</span><span class="named-paragraph-number">6.5.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> = </span><a href="3-lv.html#SP9" class="function-link"><span class="function-syntax">LocalVariables::new_internal</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_1_1_1" class="named-paragraph-link"><span class="named-paragraph">Set the kind of the new variable</span><span class="named-paragraph-number">6.5.1.1.1</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5_1">&#167;6.5.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_1_1_1" class="paragraph-anchor"></a><b>&#167;6.5.1.1.1. </b>Finally, it's possible to set the I7 kind of a variable created by <span class="extract"><span class="extract-syntax">{-my:...}</span></span>,
though there are hardly any circumstances where this is necessary, since Inter
is typeless. But in a few cases where I7 is embedded inside Inter inside I7,
or when a block value is needed, or where we need to match against descriptions
(see below) where kind-checking comes into play, it could arise. For example:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    {-</span><span class="identifier-syntax">my:1:list</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">numbers</span><span class="plain-syntax">}</span>
</pre>
<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Set the kind of the new variable</span><span class="named-paragraph-number">6.5.1.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP11" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_object</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="3-lv.html#SP25" class="function-link"><span class="function-syntax">LocalVariables::set_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">, </span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5_1_1">&#167;6.5.1.1</a> and <a href="5-cii.html#SP6_5_1_2">&#167;6.5.1.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_2" class="paragraph-anchor"></a><b>&#167;6.5.2. </b>Variables created by phrases are by default protected from being changed
by other phrases. So that, for example, within:
</p>

<blockquote>
    <p>repeat with X running from 1 to 5:</p>
</blockquote>

<p class="commentary">it's a problem message to say something like "let X be 7". This protection
only extends to changes made at the I7 source text level, of course; our own
I6 code can do anything it likes. Protection looks like a good idea,
especially for loop counters like X, but of course it would make phrases
like:
</p>

<blockquote>
    <p>let Y be 2;</p>
</blockquote>

<p class="commentary">unable to make variables, only constants. So the <span class="extract"><span class="extract-syntax">{-unprotect:...}</span></span> command
lifts the protection on the variable named:
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "unprotect"</span><span class="named-paragraph-number">6.5.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">v</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><a href="5-cii.html#SP10" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="identifier-syntax">idb</span><span class="plain-syntax">, </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">local_variable</span><span class="plain-syntax"> *</span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Lvalues::get_local_variable_if_any</span><span class="plain-syntax">(</span><span class="identifier-syntax">v</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">) </span><a href="3-lv.html#SP8" class="function-link"><span class="function-syntax">LocalVariables::unprotect</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_2_1" class="named-paragraph-link"><span class="named-paragraph">Issue a no-such-local problem message</span><span class="named-paragraph-number">6.5.2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5">&#167;6.5</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_3" class="paragraph-anchor"></a><b>&#167;6.5.3. </b>Something to be careful of is that a variable created with <span class="extract"><span class="extract-syntax">{-my:...}</span></span>,
or indeed a variable created explicitly by the phrase, may not begin with
contents which are typesafe for the kind you intend it to hold. Usually this
doesn't matter because it is immediately written with some value which is
indeed typesafe, and there's no problem. But if not, <span class="extract"><span class="extract-syntax">{-initialise:var:kind}</span></span>
takes the named local variable and gives it the default value for that kind.
If the kind is omitted, the default is to use the kind of the variable. For example,
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    {-</span><span class="identifier-syntax">my:1:time</span><span class="plain-syntax">}{-</span><span class="identifier-syntax">initialise:1</span><span class="plain-syntax">}</span>
</pre>
<p class="commentary">Note that this works only for kinds of word value, like "time". For kinds
of block value, like "list of numbers", it does nothing. This may seem odd,
but the point is that locals of that kind are automatically set to their
default values when created, so they are always typesafe anyway.
</p>

<p class="commentary">Note also that the Dash typechecker allows the creation of local variables
whose kinds are subkinds of objects which may have no instances. For example,
in this program:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">A</span><span class="plain-syntax"> </span><span class="identifier-syntax">cat</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">animal</span><span class="plain-syntax">.</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">discuss</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">felines:</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">let</span><span class="plain-syntax"> </span><span class="identifier-syntax">C</span><span class="plain-syntax"> </span><span class="identifier-syntax">be</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">cat</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        ...</span>
</pre>
<p class="commentary">...it is legal to construct the variable <span class="extract"><span class="extract-syntax">C</span></span> with kind <span class="extract"><span class="extract-syntax">cat</span></span>, even though there
are no cats in the world, so that a call to <span class="extract"><span class="extract-syntax">DefaultValues::val</span></span> would
generate a problem message. But we call <span class="extract"><span class="extract-syntax">DefaultValues::val_allowing_nothing</span></span>
instead, so that <span class="extract"><span class="extract-syntax">C</span></span> is created but with the value <span class="extract"><span class="extract-syntax">nothing</span></span>.
</p>

<p class="commentary">This would be easier to understand if Inform's kinds system supported "optionals".
In the Swift language, for example, there would be a clear distinction between
the types <span class="extract"><span class="extract-syntax">Cat</span></span> (runtime values must be instances of cat) and <span class="extract"><span class="extract-syntax">Cat?</span></span> (runtime
values must be instances of cat or else <span class="extract"><span class="extract-syntax">nothing</span></span>). In Inform, cat-valued global
variables and properties have the type <span class="extract"><span class="extract-syntax">Cat</span></span>, but cat-valued locals have the
type <span class="extract"><span class="extract-syntax">Cat?</span></span>. We do this to make it more convenient to write functions about
cats which will compile whether or not any cats exist; an extension might provide
such functions, for example, providing functionality which is only used if cats
do exist, but which should still compile without errors even if they do not.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "initialise"</span><span class="named-paragraph-number">6.5.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">V</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP10" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">idb</span><span class="plain-syntax">, </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">local_variable</span><span class="plain-syntax"> *</span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Lvalues::get_local_variable_if_any</span><span class="plain-syntax">(</span><span class="identifier-syntax">V</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP11" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">V</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Behaviour::uses_block_values</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-cb.html#SP14" class="function-link"><span class="function-syntax">CodeBlocks::inside_a_loop_body</span></a><span class="plain-syntax">()) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::call</span><span class="plain-syntax">(</span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">COPYPV_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">lvar_s</span><span class="plain-syntax"> = </span><a href="3-lv.html#SP1" class="function-link"><span class="function-syntax">LocalVariables::declare</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">EmitCode::val_symbol</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">lvar_s</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">DefaultValues::val</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">V</span><span class="plain-syntax">), </span><span class="string-syntax">"value"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">STORE_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">lvar_s</span><span class="plain-syntax"> = </span><a href="3-lv.html#SP1" class="function-link"><span class="function-syntax">LocalVariables::declare</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::ref_symbol</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">lvar_s</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><span class="identifier-syntax">DefaultValues::val_allowing_nothing</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">V</span><span class="plain-syntax">), </span><span class="string-syntax">"value"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_NoNaturalDefault</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                </span><span class="string-syntax">"To achieve %1, we'd need to be able to store a default value of "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"the kind '%2', but there's no natural choice for this."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5">&#167;6.5</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_4" class="paragraph-anchor"></a><b>&#167;6.5.4. </b>The <span class="extract"><span class="extract-syntax">{-copy:...}</span></span> command allows us to copy the content in a token or variable
into any storage item (a local variable, a global, a table entry, a list entry),
regardless of its kind of value. For example:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">let</span><span class="plain-syntax"> (</span><span class="identifier-syntax">t</span><span class="plain-syntax"> - </span><span class="identifier-syntax">nonexisting</span><span class="plain-syntax"> </span><span class="identifier-syntax">variable</span><span class="plain-syntax">) </span><span class="identifier-syntax">be</span><span class="plain-syntax"> (</span><span class="identifier-syntax">u</span><span class="plain-syntax"> - </span><span class="identifier-syntax">value</span><span class="plain-syntax">) (</span><span class="identifier-syntax">assignment</span><span class="plain-syntax"> </span><span class="identifier-syntax">operation</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- {-</span><span class="identifier-syntax">unprotect</span><span class="plain-syntax">:</span><span class="identifier-syntax">t</span><span class="plain-syntax">}{-</span><span class="identifier-syntax">copy</span><span class="plain-syntax">:</span><span class="identifier-syntax">t</span><span class="plain-syntax">:</span><span class="identifier-syntax">u</span><span class="plain-syntax">} -).</span>
</pre>
<p class="commentary">This may look superfluous: for example, in response to "let X be 10" it generates
code equivalent to <span class="extract"><span class="extract-syntax">tmp_0 = 10;</span></span>, which could have been achieved equally well with:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    (- {-</span><span class="identifier-syntax">unprotect:t</span><span class="plain-syntax">}{</span><span class="identifier-syntax">t</span><span class="plain-syntax">} = {</span><span class="identifier-syntax">u</span><span class="plain-syntax">}; -)</span>
</pre>
<p class="commentary">But it makes something much more elaborate in response to, say, "let Y be the
list of people in dark rooms", where it's important to keep track of the allocation
and deallocation of dynamic lists, since Y is a block value. The point of the
<span class="extract"><span class="extract-syntax">{-copy:to:from}</span></span> command is to hide all that complexity from the definition.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "copy"</span><span class="named-paragraph-number">6.5.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">copy_form</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">from</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">to</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_4_1" class="named-paragraph-link"><span class="named-paragraph">Find what we are copying from, to and how</span><span class="named-paragraph-number">6.5.4.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_4_2" class="named-paragraph-link"><span class="named-paragraph">Check that we're not copying to something the user isn't allowed to change</span><span class="named-paragraph-number">6.5.4.2</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">pcalc_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">pt1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Terms::new_constant</span><span class="plain-syntax">(</span><span class="identifier-syntax">to</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">pcalc_term</span><span class="plain-syntax"> </span><span class="identifier-syntax">pt2</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Terms::new_constant</span><span class="plain-syntax">(</span><span class="identifier-syntax">from</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">to</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K2</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">from</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">node_type_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">storage_class</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Lvalues::get_storage_form</span><span class="plain-syntax">(</span><span class="identifier-syntax">to</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">copy_form</span><span class="plain-syntax"> != </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_4_3" class="named-paragraph-link"><span class="named-paragraph">Check that increment or decrement make sense</span><span class="named-paragraph-number">6.5.4.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">prototype</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><a href="2-cl.html#SP4" class="function-link"><span class="function-syntax">CompileLvalues::interpret_store</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">prototype</span><span class="plain-syntax">, </span><span class="identifier-syntax">storage_class</span><span class="plain-syntax">, </span><span class="identifier-syntax">K1</span><span class="plain-syntax">, </span><span class="identifier-syntax">K2</span><span class="plain-syntax">, </span><span class="identifier-syntax">copy_form</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">i6_schema</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sch</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Calculus::Schemas::new</span><span class="plain-syntax">(</span><span class="string-syntax">"%S;"</span><span class="plain-syntax">, </span><span class="identifier-syntax">prototype</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOGIF</span><span class="plain-syntax">(</span><span class="identifier-syntax">KIND_CHECKING</span><span class="plain-syntax">, </span><span class="string-syntax">"Inline copy: %S\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">prototype</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="4-cs.html#SP1" class="function-link"><span class="function-syntax">CompileSchemas::from_terms_in_val_context</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">sch</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">pt1</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">pt2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">prototype</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5">&#167;6.5</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_4_1" class="paragraph-anchor"></a><b>&#167;6.5.4.1. </b>If the <span class="extract"><span class="extract-syntax">from</span></span> part is prefaced with a plus sign <span class="extract"><span class="extract-syntax">+</span></span>, the new value is added
to the current value rather than replacing it; if <span class="extract"><span class="extract-syntax">-</span></span>, it's subtracted. For
example,
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">increase</span><span class="plain-syntax"> (</span><span class="identifier-syntax">S</span><span class="plain-syntax"> - </span><span class="identifier-syntax">storage</span><span class="plain-syntax">) </span><span class="identifier-syntax">by</span><span class="plain-syntax"> (</span><span class="identifier-syntax">w</span><span class="plain-syntax"> - </span><span class="identifier-syntax">value</span><span class="plain-syntax">) (</span><span class="identifier-syntax">assignment</span><span class="plain-syntax"> </span><span class="identifier-syntax">operation</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- {-</span><span class="identifier-syntax">copy</span><span class="plain-syntax">:</span><span class="identifier-syntax">S</span><span class="plain-syntax">:+</span><span class="identifier-syntax">w</span><span class="plain-syntax">} -).</span>
</pre>
<p class="commentary">Lastly, it's also legal to write just a <span class="extract"><span class="extract-syntax">+</span></span> or <span class="extract"><span class="extract-syntax">-</span></span> sign alone, which increments
or decrements. But be wary here, because <span class="extract"><span class="extract-syntax">{-copy:S:+}</span></span> adds 1 to S, whereas
<span class="extract"><span class="extract-syntax">{-copy:S:+1}</span></span> adds the value of the variable {-my:1} to S.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Find what we are copying from, to and how</span><span class="named-paragraph-number">6.5.4.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">from_p</span><span class="plain-syntax">)</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">c</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::get_first_char</span><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">c</span><span class="plain-syntax"> == </span><span class="character-syntax">'+'</span><span class="plain-syntax">) { </span><span class="identifier-syntax">copy_form</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="identifier-syntax">Str::copy_tail</span><span class="plain-syntax">(</span><span class="identifier-syntax">from_p</span><span class="plain-syntax">, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">); }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">c</span><span class="plain-syntax"> == </span><span class="character-syntax">'-'</span><span class="plain-syntax">) { </span><span class="identifier-syntax">copy_form</span><span class="plain-syntax"> = -1; </span><span class="identifier-syntax">Str::copy_tail</span><span class="plain-syntax">(</span><span class="identifier-syntax">from_p</span><span class="plain-syntax">, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">); }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">Str::copy</span><span class="plain-syntax">(</span><span class="identifier-syntax">from_p</span><span class="plain-syntax">, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">from_p</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">copy_form</span><span class="plain-syntax"> != </span><span class="constant-syntax">0</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">from</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Rvalues::from_int</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">from_p</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">from</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP10" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">from_p</span><span class="plain-syntax">, </span><span class="identifier-syntax">idb</span><span class="plain-syntax">, </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">to</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP10" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="identifier-syntax">idb</span><span class="plain-syntax">, </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">to</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">from</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_stream</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_stream</span><span class="plain-syntax">(5, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::inline_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_InlineCopy</span><span class="plain-syntax">), </span><span class="identifier-syntax">idb</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">owner</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">parent_schema</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">converted_from</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"The command to {-copy:...}, which asks to copy '%5' into '%4', has "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"gone wrong: I couldn't work those out."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">from_p</span><span class="plain-syntax">)</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5_4">&#167;6.5.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_4_2" class="paragraph-anchor"></a><b>&#167;6.5.4.2. </b>Use of <span class="extract"><span class="extract-syntax">{-copy:...}</span></span> will produce problem messages if the target is a protected
local variable, or a global which isn't allowed to change in play (such as the
story title).
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Check that we're not copying to something the user isn't allowed to change</span><span class="named-paragraph-number">6.5.4.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">nonlocal_variable</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nlv</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Lvalues::get_nonlocal_variable_if_any</span><span class="plain-syntax">(</span><span class="identifier-syntax">to</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">nlv</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">NonlocalVariables::must_be_constant</span><span class="plain-syntax">(</span><span class="identifier-syntax">nlv</span><span class="plain-syntax">))) </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">nlv</span><span class="plain-syntax">) </span><span class="identifier-syntax">NonlocalVariables::warn_about_change</span><span class="plain-syntax">(</span><span class="identifier-syntax">nlv</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">local_variable</span><span class="plain-syntax"> *</span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Lvalues::get_local_variable_if_any</span><span class="plain-syntax">(</span><span class="identifier-syntax">to</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">) &amp;&amp; (</span><a href="3-lv.html#SP8" class="function-link"><span class="function-syntax">LocalVariables::protected</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">))) </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5_4">&#167;6.5.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_4_3" class="paragraph-anchor"></a><b>&#167;6.5.4.3. </b>One can't, for example, increment a backdrop, or a text.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Check that increment or decrement make sense</span><span class="named-paragraph-number">6.5.4.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Behaviour::is_quasinumerical</span><span class="plain-syntax">(</span><span class="identifier-syntax">K1</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">K1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_CantIncrementKind</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"To achieve %1, we'd need to be able to add or subtract 1 from a value of "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"the kind '%2', but there's no good way to do this."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5_4">&#167;6.5.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_5" class="paragraph-anchor"></a><b>&#167;6.5.5. </b>These are needed to apply stricter kind-checking to phrases like "the X
which relates to Y by R". For example, if R relates containers to doors then
"the vehicle which relates to the oak door by R" is unsafe because what relates
to the oak door may be a container which is not a vehicle.
</p>

<p class="commentary">There are two forms according to which domain is implied.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "match-left-relation-domain"</span><span class="named-paragraph-number">6.5.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">X</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP11" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">R</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP10" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">, </span><span class="identifier-syntax">idb</span><span class="plain-syntax">, </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">KR</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::get_construct</span><span class="plain-syntax">(</span><span class="identifier-syntax">KR</span><span class="plain-syntax">) == </span><span class="identifier-syntax">CON_relation</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">; </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">unwanted</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Kinds::binary_construction_material</span><span class="plain-syntax">(</span><span class="identifier-syntax">KR</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">unwanted</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_5_1" class="named-paragraph-link"><span class="named-paragraph">Check there is strict conformance on this domain</span><span class="named-paragraph-number">6.5.5.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5">&#167;6.5</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_6" class="paragraph-anchor"></a><b>&#167;6.5.6. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "match-right-relation-domain"</span><span class="named-paragraph-number">6.5.6</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">X</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP11" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">R</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP10" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">, </span><span class="identifier-syntax">idb</span><span class="plain-syntax">, </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">KR</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::get_construct</span><span class="plain-syntax">(</span><span class="identifier-syntax">KR</span><span class="plain-syntax">) == </span><span class="identifier-syntax">CON_relation</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">unwanted</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">; </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Kinds::binary_construction_material</span><span class="plain-syntax">(</span><span class="identifier-syntax">KR</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">unwanted</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_5_1" class="named-paragraph-link"><span class="named-paragraph">Check there is strict conformance on this domain</span><span class="named-paragraph-number">6.5.5.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5">&#167;6.5</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_5_1" class="paragraph-anchor"></a><b>&#167;6.5.5.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Check there is strict conformance on this domain</span><span class="named-paragraph-number">6.5.5.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::conforms_to</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">X</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">X</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(3, </span><span class="identifier-syntax">KR</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_RelationDomainWrongKind</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"You wrote %1, but the kinds here do not quite match: what we "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"have is %3, and %4 is not necessarily %2."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5_5">&#167;6.5.5</a> and <a href="5-cii.html#SP6_5_6">&#167;6.5.6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_7" class="paragraph-anchor"></a><b>&#167;6.5.7. </b>The next command generates code able to test if a token in the invocation,
or an Inter variable, matches a given description &mdash; which need not be constant.
For example, if the phrase prototype includes the token <span class="extract"><span class="extract-syntax">(OS - description of objects)</span></span>
then the bracing <span class="extract"><span class="extract-syntax">{-matches-description:1:OS}</span></span> compiles a condition testing whether
the object in variable <span class="extract"><span class="extract-syntax">{-my:1}</span></span> matches the description or not.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "matches-description"</span><span class="named-paragraph-number">6.5.7</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">to_match</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><a href="5-cii.html#SP10" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">, </span><span class="identifier-syntax">idb</span><span class="plain-syntax">, </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">to_test</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><a href="5-cii.html#SP10" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="identifier-syntax">idb</span><span class="plain-syntax">, </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">to_test</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">to_match</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_stream</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_stream</span><span class="plain-syntax">(5, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::inline_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_InlineMatchesDescription</span><span class="plain-syntax">), </span><span class="identifier-syntax">idb</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">owner</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">parent_schema</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">converted_from</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"The command {-matches-description:...}, which asks to test whether "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"'%5' is a valid description for '%4', has gone wrong: I couldn't "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"work those out."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><a href="4-cp.html#SP6" class="function-link"><span class="function-syntax">CompilePropositions::to_test_if_matches</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">to_test</span><span class="plain-syntax">, </span><span class="identifier-syntax">to_match</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5">&#167;6.5</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_8" class="paragraph-anchor"></a><b>&#167;6.5.8. </b>This is the same, except that it compiles code to assert that the given
variable matches the given description.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "now-matches-description"</span><span class="named-paragraph-number">6.5.8</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">to_test</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><a href="5-cii.html#SP10" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="identifier-syntax">idb</span><span class="plain-syntax">, </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">to_match</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><a href="5-cii.html#SP10" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">, </span><span class="identifier-syntax">idb</span><span class="plain-syntax">, </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">to_test</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">to_match</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_stream</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_stream</span><span class="plain-syntax">(5, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::inline_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_InlineNowMatchesDescription</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">idb</span><span class="plain-syntax">, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">owner</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">parent_schema</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">converted_from</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"The command {-now-matches-description:...}, which asks to change '%4' so "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"that '%5' becomes a valid description of it, has gone wrong: I couldn't "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"work those out."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">pcalc_prop</span><span class="plain-syntax"> *</span><span class="identifier-syntax">prop</span><span class="plain-syntax"> = </span><span class="identifier-syntax">SentencePropositions::from_spec</span><span class="plain-syntax">(</span><span class="identifier-syntax">to_match</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="4-cp.html#SP5" class="function-link"><span class="function-syntax">CompilePropositions::to_make_true_about</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">prop</span><span class="plain-syntax">, </span><span class="identifier-syntax">to_test</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5">&#167;6.5</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_9" class="paragraph-anchor"></a><b>&#167;6.5.9. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "arithmetic-operation"</span><span class="named-paragraph-number">6.5.9</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="identifier-syntax">IDTypeData::arithmetic_operation</span><span class="plain-syntax">(</span><span class="identifier-syntax">idb</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">binary</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Dimensions::arithmetic_op_is_unary</span><span class="plain-syntax">(</span><span class="identifier-syntax">op</span><span class="plain-syntax">)) </span><span class="identifier-syntax">binary</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">X</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">Y</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">KX</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">KY</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_9_1" class="named-paragraph-link"><span class="named-paragraph">Read the operands and their kinds</span><span class="named-paragraph-number">6.5.9.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="5-ca.html#SP1" class="function-link"><span class="function-syntax">CompileArithmetic::perform_arithmetic_emit</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">op</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">X</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">KX</span><span class="plain-syntax">, </span><span class="identifier-syntax">Y</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">KY</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5">&#167;6.5</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_9_1" class="paragraph-anchor"></a><b>&#167;6.5.9.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Read the operands and their kinds</span><span class="named-paragraph-number">6.5.9.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">X</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP10" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="identifier-syntax">idb</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">KX</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">X</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">binary</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Y</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP10" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">, </span><span class="identifier-syntax">idb</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">KY</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">Y</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5_9">&#167;6.5.9</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_10" class="paragraph-anchor"></a><b>&#167;6.5.10. </b>This prints a token or variable using the correct format for its kind. The
code below optimises this so that constant text is printed directly, rather
than stored as a constant text value and printed by a call to <span class="extract"><span class="extract-syntax">TEXT_TY_Say</span></span>:
this saves 2 words of memory and a function call at print time. But the
result would be the same without the optimisation.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "say"</span><span class="named-paragraph-number">6.5.10</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">to_say</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><a href="5-cii.html#SP10" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="identifier-syntax">idb</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">to_say</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_2_1" class="named-paragraph-link"><span class="named-paragraph">Issue a no-such-local problem message</span><span class="named-paragraph-number">6.5.2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><a href="5-cii.html#SP11" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand2</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Node::get_kind_variable_declarations</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">));</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_text</span><span class="plain-syntax">)) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_10_1" class="named-paragraph-link"><span class="named-paragraph">Inline say text</span><span class="named-paragraph-number">6.5.10.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_number</span><span class="plain-syntax">)) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_10_2" class="named-paragraph-link"><span class="named-paragraph">Inline say number</span><span class="named-paragraph-number">6.5.10.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_unicode_character</span><span class="plain-syntax">)) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_10_3" class="named-paragraph-link"><span class="named-paragraph">Inline say unicode character</span><span class="named-paragraph-number">6.5.10.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::call</span><span class="plain-syntax">(</span><span class="identifier-syntax">RTKindConstructors::printing_fn_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><a href="2-cv.html#SP5" class="function-link"><span class="function-syntax">CompileValues::to_code_val_of_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">to_say</span><span class="plain-syntax">, </span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_2_1_2" class="named-paragraph-link"><span class="named-paragraph">Issue an inline no-such-kind problem</span><span class="named-paragraph-number">6.2.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5">&#167;6.5</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_10_1" class="paragraph-anchor"></a><b>&#167;6.5.10.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline say text</span><span class="named-paragraph-number">6.5.10.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">SW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">to_say</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Rvalues::is_CONSTANT_of_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">to_say</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_text</span><span class="plain-syntax">)) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Wordings::length</span><span class="plain-syntax">(</span><span class="identifier-syntax">SW</span><span class="plain-syntax">) == </span><span class="constant-syntax">1</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Vocabulary::test_flags</span><span class="plain-syntax">(</span><span class="identifier-syntax">Wordings::first_wn</span><span class="plain-syntax">(</span><span class="identifier-syntax">SW</span><span class="plain-syntax">), </span><span class="identifier-syntax">TEXTWITHSUBS_MC</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">PRINT_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">T</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">TranscodeText::from_wide_string_for_emission</span><span class="plain-syntax">(</span><span class="identifier-syntax">T</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Lexer::word_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">Wordings::first_wn</span><span class="plain-syntax">(</span><span class="identifier-syntax">SW</span><span class="plain-syntax">)));</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::val_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">T</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">T</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">to_say</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::call</span><span class="plain-syntax">(</span><span class="identifier-syntax">RTKindConstructors::printing_fn_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><a href="2-cv.html#SP5" class="function-link"><span class="function-syntax">CompileValues::to_code_val_of_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">to_say</span><span class="plain-syntax">, </span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5_10">&#167;6.5.10</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_10_2" class="paragraph-anchor"></a><b>&#167;6.5.10.2. </b>Numbers are also handled directly...
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline say number</span><span class="named-paragraph-number">6.5.10.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">PRINTNUMBER_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">STORE_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::ref_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_number</span><span class="plain-syntax">, </span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">SAY__N_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><a href="2-cv.html#SP5" class="function-link"><span class="function-syntax">CompileValues::to_code_val_of_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">to_say</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5_10">&#167;6.5.10</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_10_3" class="paragraph-anchor"></a><b>&#167;6.5.10.3. </b>And similarly for Unicode characters. It would be tidier to abstract this
with a function call, but it would cost a function call.
</p>

<p class="commentary">Note that emitting a Unicode character is currently done with direct assembly
language.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline say unicode character</span><span class="named-paragraph-number">6.5.10.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">STORE_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::ref_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_number</span><span class="plain-syntax">, </span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">UNICODE_TEMP_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><a href="2-cv.html#SP5" class="function-link"><span class="function-syntax">CompileValues::to_code_val_of_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">to_say</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">TargetVMs::is_16_bit</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::vm</span><span class="plain-syntax">())) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Produce::inv_assembly</span><span class="plain-syntax">(</span><span class="identifier-syntax">Emit::tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">I</span><span class="string-syntax">"@print_unicode"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_number</span><span class="plain-syntax">, </span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">UNICODE_TEMP_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Produce::inv_assembly</span><span class="plain-syntax">(</span><span class="identifier-syntax">Emit::tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">I</span><span class="string-syntax">"@streamunichar"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_number</span><span class="plain-syntax">, </span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">UNICODE_TEMP_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5_10">&#167;6.5.10</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_11" class="paragraph-anchor"></a><b>&#167;6.5.11. </b>This is for debugging purposes only: it does the equivalent of the "showme"
phrase applied to the named variable.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "show-me"</span><span class="named-paragraph-number">6.5.11</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">to_show</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><a href="5-cii.html#SP10" class="function-link"><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="identifier-syntax">idb</span><span class="plain-syntax">, </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">to_show</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_5_2_1" class="named-paragraph-link"><span class="named-paragraph">Issue a no-such-local problem message</span><span class="named-paragraph-number">6.5.2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">IFDEBUG_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::code</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><a href="5-cii.html#SP15" class="function-link"><span class="function-syntax">CSIInline::emit_showme</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">to_show</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5">&#167;6.5</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_6" class="paragraph-anchor"></a><b>&#167;6.6. Miscellaneous commands.</b>These really have nothing in common, except that each can be used only in
very special circumstances.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Expand a bracing containing a miscellaneous command</span><span class="named-paragraph-number">6.6</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">segment_count_ISINC</span><span class="plain-syntax">)        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_6_1" class="named-paragraph-link"><span class="named-paragraph">Inline command "segment-count"</span><span class="named-paragraph-number">6.6.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">final_segment_marker_ISINC</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_6_2" class="named-paragraph-link"><span class="named-paragraph">Inline command "final-segment-marker"</span><span class="named-paragraph-number">6.6.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">list_together_ISINC</span><span class="plain-syntax">)        </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_6_3" class="named-paragraph-link"><span class="named-paragraph">Inline command "list-together"</span><span class="named-paragraph-number">6.6.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">rescale_ISINC</span><span class="plain-syntax">)              </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_6_4" class="named-paragraph-link"><span class="named-paragraph">Inline command "rescale"</span><span class="named-paragraph-number">6.6.4</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_6_1" class="paragraph-anchor"></a><b>&#167;6.6.1. </b>These two are publicly documented, and have to do with multiple-segment
"say" phrases.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "segment-count"</span><span class="named-paragraph-number">6.6.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::val_number</span><span class="plain-syntax">((</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">Annotations::read_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">ssp_segment_count_ANNOT</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_6">&#167;6.6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_6_2" class="paragraph-anchor"></a><b>&#167;6.6.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "final-segment-marker"</span><span class="named-paragraph-number">6.6.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Annotations::read_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">ssp_closing_segment_wn_ANNOT</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">NULL_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">T</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">T</span><span class="plain-syntax">, </span><span class="string-syntax">"%~W"</span><span class="plain-syntax">, </span><span class="identifier-syntax">Wordings::one_word</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Annotations::read_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">inv</span><span class="plain-syntax">, </span><span class="identifier-syntax">ssp_closing_segment_wn_ANNOT</span><span class="plain-syntax">)));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">T_s</span><span class="plain-syntax"> = </span><span class="identifier-syntax">IdentifierFinders::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">Emit::tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">T</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">IdentifierFinders::common_names_only</span><span class="plain-syntax">());</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::val_symbol</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">T_s</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">T</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_6">&#167;6.6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_6_3" class="paragraph-anchor"></a><b>&#167;6.6.3. </b>This is a shim for an old Inform 6 library feature. It's used only to define
the "group... together" phrases.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "list-together"</span><span class="named-paragraph-number">6.6.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">inline_subcommand</span><span class="plain-syntax"> == </span><span class="identifier-syntax">unarticled_ISINSC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">iname</span><span class="plain-syntax"> = </span><span class="identifier-syntax">GroupTogether::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">iname</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">inline_subcommand</span><span class="plain-syntax"> == </span><span class="identifier-syntax">articled_ISINSC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">iname</span><span class="plain-syntax"> = </span><span class="identifier-syntax">GroupTogether::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">iname</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">StandardProblems::inline_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_InlineListTogether</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">idb</span><span class="plain-syntax">, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">owner</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">parent_schema</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">converted_from</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"The only legal forms here are {-list-together:articled} and "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"{-list-together:unarticled}."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_6">&#167;6.6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_6_4" class="paragraph-anchor"></a><b>&#167;6.6.4. </b>This exists to manage scaled arithmetic, and should only be used for the
mathematical definitions in the Standard Rules.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inline command "rescale"</span><span class="named-paragraph-number">6.6.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_RescaleWithdrawn</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="string-syntax">"I attempted to compile %1 using its inline definition, "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"but this contained the invalid annotation '{-rescale:...}', "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"which has been withdrawn."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_6">&#167;6.6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_7" class="paragraph-anchor"></a><b>&#167;6.7. Primitive definitions.</b>Some phrases are just too complicated to express in invocation language,
especially those involving complicated linguistic propositions.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Expand an entirely internal-made definition</span><span class="named-paragraph-number">6.7</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">inline_subcommand</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">repeat_through_ISINSC:</span>
<span class="plain-syntax">            </span><a href="4-cl.html#SP1" class="function-link"><span class="function-syntax">CompileLoops::through_matches</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[1],</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Lvalues::get_local_variable_if_any</span><span class="plain-syntax">(</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[0]));</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">repeat_through_list_ISINSC:</span>
<span class="plain-syntax">            </span><a href="4-cl.html#SP4" class="function-link"><span class="function-syntax">CompileLoops::through_list</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[1],</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Lvalues::get_local_variable_if_any</span><span class="plain-syntax">(</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[0]));</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">number_of_ISINSC:</span>
<span class="plain-syntax">            </span><a href="4-cp.html#SP6" class="function-link"><span class="function-syntax">CompilePropositions::to_number_of_matches</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">random_of_ISINSC:</span>
<span class="plain-syntax">            </span><a href="4-cp.html#SP6" class="function-link"><span class="function-syntax">CompilePropositions::to_random_match</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">total_of_ISINSC:</span>
<span class="plain-syntax">            </span><a href="4-cp.html#SP6" class="function-link"><span class="function-syntax">CompilePropositions::to_total_of_matches</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Rvalues::to_property</span><span class="plain-syntax">(</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[0]), </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[1]);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">extremal_ISINSC:</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">extremal_property_sign</span><span class="plain-syntax"> != </span><span class="identifier-syntax">MEASURE_T_EXACTLY</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">extremal_property</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                </span><a href="4-cp.html#SP6" class="function-link"><span class="function-syntax">CompilePropositions::to_extremal_match</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[0],</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">extremal_property</span><span class="plain-syntax">, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">extremal_property_sign</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">StandardProblems::inline_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_InlineExtremal</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">idb</span><span class="plain-syntax">, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">owner</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">parent_schema</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">converted_from</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="string-syntax">"In the '{-primitive-definition:extremal...}' command, there should "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"be a '&lt;' or '&gt;' sign then the name of a property."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">function_application_ISINSC:</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_7_1" class="named-paragraph-link"><span class="named-paragraph">Primitive "function-application"</span><span class="named-paragraph-number">6.7.1</span></a></span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">description_application_ISINSC:</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_7_2" class="named-paragraph-link"><span class="named-paragraph">Primitive "description-application"</span><span class="named-paragraph-number">6.7.2</span></a></span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">solve_equation_ISINSC:</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP6_7_3" class="named-paragraph-link"><span class="named-paragraph">Primitive "solve-equation"</span><span class="named-paragraph-number">6.7.3</span></a></span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">switch_ISINSC:</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">break_ISINSC:</span>
<span class="plain-syntax">            </span><a href="3-cb.html#SP16" class="function-link"><span class="function-syntax">CodeBlocks::emit_break</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">verbose_checking_ISINSC:</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> *</span><span class="identifier-syntax">what</span><span class="plain-syntax"> = </span><span class="identifier-syntax">U</span><span class="string-syntax">""</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tokens_count</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">aspect</span><span class="plain-syntax"> = </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[0];</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wordings::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">aspect</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">aw1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Wordings::first_wn</span><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">aspect</span><span class="plain-syntax">));</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">Word::dequote</span><span class="plain-syntax">(</span><span class="identifier-syntax">aw1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">what</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Lexer::word_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">aw1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                }</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Dash::tracing_phrases</span><span class="plain-syntax">(</span><span class="identifier-syntax">what</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">default:</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Problems::quote_stream</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">StandardProblems::inline_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_InlinePrimitive</span><span class="plain-syntax">), </span><span class="identifier-syntax">idb</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">owner</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">parent_schema</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">converted_from</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="string-syntax">"I don't know any primitive definition called '%4'."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_7_1" class="paragraph-anchor"></a><b>&#167;6.7.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Primitive "function-application"</span><span class="named-paragraph-number">6.7.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">fn</span><span class="plain-syntax"> = </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[0];</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">fn_kind</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">fn</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">X</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">Y</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::get_construct</span><span class="plain-syntax">(</span><span class="identifier-syntax">fn_kind</span><span class="plain-syntax">) != </span><span class="identifier-syntax">CON_phrase</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_spec</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">fn</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::inline_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_InlineFunctionApplication</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">idb</span><span class="plain-syntax">, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">owner</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">parent_schema</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">converted_from</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"A function application only makes sense if the first token, "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"'%4', is a phrase: here it isn't."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Kinds::binary_construction_material</span><span class="plain-syntax">(</span><span class="identifier-syntax">fn_kind</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">X</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">Y</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=1; </span><span class="identifier-syntax">i</span><span class="function-syntax">&lt;tokens-&gt;</span><span class="element-syntax">tokens_count</span><span class="plain-syntax">; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">-1] = </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">];</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">head</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">tail</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Kinds::binary_construction_material</span><span class="plain-syntax">(</span><span class="identifier-syntax">X</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">head</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">tail</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">X</span><span class="plain-syntax"> = </span><span class="identifier-syntax">tail</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_kinds</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">-1] = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Kinds::Behaviour::uses_block_values</span><span class="plain-syntax">(</span><span class="identifier-syntax">head</span><span class="plain-syntax">)) &amp;&amp;</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">Kinds::Behaviour::definite</span><span class="plain-syntax">(</span><span class="identifier-syntax">head</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_kinds</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">-1] = </span><span class="identifier-syntax">head</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tokens_count</span><span class="plain-syntax">--;</span>

<span class="plain-syntax">    </span><a href="5-ciac.html#SP3" class="function-link"><span class="function-syntax">CallingFunctions::indirect_function_call</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">fn</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_7">&#167;6.7</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_7_2" class="paragraph-anchor"></a><b>&#167;6.7.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Primitive "description-application"</span><span class="named-paragraph-number">6.7.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">fn</span><span class="plain-syntax"> = </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[1];</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[1] = </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[0];</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[0] = </span><span class="identifier-syntax">Rvalues::from_int</span><span class="plain-syntax">(-1, </span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tokens_count</span><span class="plain-syntax"> = </span><span class="constant-syntax">2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="5-ciac.html#SP3" class="function-link"><span class="function-syntax">CallingFunctions::indirect_function_call</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="identifier-syntax">fn</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_7">&#167;6.7</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_7_3" class="paragraph-anchor"></a><b>&#167;6.7.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Primitive "solve-equation"</span><span class="named-paragraph-number">6.7.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Rvalues::is_CONSTANT_of_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[1], </span><span class="identifier-syntax">K_equation</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><a href="5-cste.html#SP2" class="function-link"><span class="function-syntax">EquationSolver::compile_solution</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[0]),</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Rvalues::to_equation</span><span class="plain-syntax">(</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[1]));</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_SolvedNameless</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="string-syntax">"only specific named equations can be solved"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"not equations arrived at by further calculations or choices. (Sorry: "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"but there would be no safe way to determine when an equation could "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"be used, because all equations have differing natures and variables.)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_7">&#167;6.7</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5_2_1" class="paragraph-anchor"></a><b>&#167;6.5.2.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue a no-such-local problem message</span><span class="named-paragraph-number">6.5.2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_stream</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">operand</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::inline_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_InlineNoSuch</span><span class="plain-syntax">), </span><span class="identifier-syntax">idb</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">ist</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">owner</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">parent_schema</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">converted_from</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"I don't know any local variable called '%4'."</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP6_5_2">&#167;6.5.2</a>, <a href="5-cii.html#SP6_5_10">&#167;6.5.10</a> and <a href="5-cii.html#SP6_5_11">&#167;6.5.11</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. Parsing the invocation operands.</b>Two ways. First, as an identifier name, which stands for a local Inter variable
or for a token in the phrase being invoked. There are three ways we can
write this:
</p>

<ul class="items"><li>(a) the operands "0" to "9", a single digit, mean the <span class="extract"><span class="extract-syntax">{-my:...}</span></span> variables
with those numbers, if they exist;
</li><li>(b) otherwise if we have the name of a token in the phrase being invoked,
then the operand refers to its value in the current invocation;
</li><li>(c) and failing that we have the name of a local Inter variable.
</li></ul>
<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">CSIInline::parse_bracing_operand_as_identifier</span></span>:<br/><a href="5-cii.html#SP6_5_2">&#167;6.5.2</a>, <a href="5-cii.html#SP6_5_3">&#167;6.5.3</a>, <a href="5-cii.html#SP6_5_4_1">&#167;6.5.4.1</a>, <a href="5-cii.html#SP6_5_5">&#167;6.5.5</a>, <a href="5-cii.html#SP6_5_6">&#167;6.5.6</a>, <a href="5-cii.html#SP6_5_7">&#167;6.5.7</a>, <a href="5-cii.html#SP6_5_8">&#167;6.5.8</a>, <a href="5-cii.html#SP6_5_9_1">&#167;6.5.9.1</a>, <a href="5-cii.html#SP6_5_10">&#167;6.5.10</a>, <a href="5-cii.html#SP6_5_11">&#167;6.5.11</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="identifier-syntax">id_body</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idb</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">tokens_packet</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tokens</span><span class="plain-syntax">, </span><span class="reserved-syntax">local_variable</span><span class="plain-syntax"> **</span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">local_variable</span><span class="plain-syntax"> *</span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">) &gt;= </span><span class="character-syntax">'0'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">) &lt;= </span><span class="character-syntax">'9'</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> = </span><span class="identifier-syntax">my_vars</span><span class="plain-syntax">[</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">) - </span><span class="character-syntax">'0'</span><span class="plain-syntax">];</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">LW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Feeds::feed_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">operand</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> = </span><a href="3-lv.html#SP17" class="function-link"><span class="function-syntax">LocalVariables::parse</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">idb</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">id_stack_frame</span><span class="plain-syntax">), </span><span class="identifier-syntax">LW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">tok</span><span class="plain-syntax"> = </span><a href="3-lv.html#SP3" class="function-link"><span class="function-syntax">LocalVariables::get_parameter_number</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tok</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">tokens</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">token_vals</span><span class="plain-syntax">[</span><span class="identifier-syntax">tok</span><span class="plain-syntax">];</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">lvar</span><span class="plain-syntax"> = </span><a href="3-lv.html#SP12" class="function-link"><span class="function-syntax">LocalVariables::find_internal</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">operand</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">lvar</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">Lvalues::new_LOCAL_VARIABLE</span><span class="plain-syntax">(</span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">, </span><span class="identifier-syntax">lvar</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. </b>The second sort of operand is a kind.
</p>

<p class="commentary">If the kind named involves kind variables A, B, C, ..., then these are
substituted with their values in the context of the invocation being made.
In addition two special kind names are recognised:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">-</span><span class="identifier-syntax">kind</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">rule</span><span class="plain-syntax">-</span><span class="reserved-syntax">return</span><span class="plain-syntax">-</span><span class="identifier-syntax">kind</span>
</pre>
<p class="commentary">The former being the return kind from the phrase we are being invoked in
(if it's a phrase to decide a value), and the latter being the kind of value
which this rule should produce (if it's a rule, and if it's in a rulebook
which wants to produce a value). For example, you could define a phrase
which would safely abandon any attempt to define a value like this:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">give</span><span class="plain-syntax"> </span><span class="identifier-syntax">up</span><span class="plain-syntax"> </span><span class="identifier-syntax">deciding</span><span class="plain-syntax">:</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">return</span><span class="plain-syntax"> {-</span><span class="identifier-syntax">new</span><span class="plain-syntax">:</span><span class="identifier-syntax">return</span><span class="plain-syntax">-</span><span class="identifier-syntax">kind</span><span class="plain-syntax">}; -).</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">CSIInline::parse_bracing_operand_as_kind</span></span>:<br/><a href="5-cii.html#SP6_2_1">&#167;6.2.1</a>, <a href="5-cii.html#SP6_2_2">&#167;6.2.2</a>, <a href="5-cii.html#SP6_2_3">&#167;6.2.3</a>, <a href="5-cii.html#SP6_2_4">&#167;6.2.4</a>, <a href="5-cii.html#SP6_2_5">&#167;6.2.5</a>, <a href="5-cii.html#SP6_2_6">&#167;6.2.6</a>, <a href="5-cii.html#SP6_2_7">&#167;6.2.7</a>, <a href="5-cii.html#SP6_2_8">&#167;6.2.8</a>, <a href="5-cii.html#SP6_2_9">&#167;6.2.9</a>, <a href="5-cii.html#SP6_2_10">&#167;6.2.10</a>, <a href="5-cii.html#SP6_5_1_1_1">&#167;6.5.1.1.1</a>, <a href="5-cii.html#SP6_5_3">&#167;6.5.3</a>, <a href="5-cii.html#SP6_5_5">&#167;6.5.5</a>, <a href="5-cii.html#SP6_5_6">&#167;6.5.6</a>, <a href="5-cii.html#SP6_5_10">&#167;6.5.10</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">operand</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind_variable_declaration</span><span class="plain-syntax"> *</span><span class="identifier-syntax">kvd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq_wide_string</span><span class="plain-syntax">(</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"return-kind"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-sf.html#SP7" class="function-link"><span class="function-syntax">Frames::get_kind_returned</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq_wide_string</span><span class="plain-syntax">(</span><span class="identifier-syntax">operand</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"rule-return-kind"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">Rulebooks::kind_from_context</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">kind_vars_inline</span><span class="plain-syntax">[27];</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;27; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) </span><span class="identifier-syntax">kind_vars_inline</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">] = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (; </span><span class="identifier-syntax">kvd</span><span class="plain-syntax">; </span><span class="identifier-syntax">kvd</span><span class="plain-syntax">=</span><span class="identifier-syntax">kvd</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next</span><span class="plain-syntax">) </span><span class="identifier-syntax">kind_vars_inline</span><span class="plain-syntax">[</span><span class="identifier-syntax">kvd</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">kv_number</span><span class="plain-syntax">] = </span><span class="identifier-syntax">kvd</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">kv_value</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> **</span><span class="identifier-syntax">saved</span><span class="plain-syntax"> = </span><a href="3-sf.html#SP8" class="function-link"><span class="function-syntax">Frames::temporarily_set_kvs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">kind_vars_inline</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">KW</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Feeds::feed_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">operand</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">spec</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;s-type-expression&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">KW</span><span class="plain-syntax">)) </span><span class="identifier-syntax">spec</span><span class="plain-syntax"> = </span><span class="function-syntax">&lt;&lt;rp&gt;&gt;</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="3-sf.html#SP8" class="function-link"><span class="function-syntax">Frames::temporarily_set_kvs</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">saved</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">K</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP12" class="paragraph-anchor"></a><b>&#167;12. Bracket-plus notation.</b>An early compromise measure in the design of Inform 7, when the language was not
as expressive as it is today, was that "template files" of Inform 6 code, and
inline phrase definitions, could use the notation <span class="extract"><span class="extract-syntax">(+ ... +)</span></span> to reinsert
high-level Inform 7 source text inside lower-level Inform 6 notation. Thus, for
example,
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    (- </span><span class="identifier-syntax">print</span><span class="plain-syntax"> (+ </span><span class="identifier-syntax">time</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">day</span><span class="plain-syntax"> +); -)</span>
</pre>
<p class="commentary">is a valid inline definition.
</p>

<p class="commentary">This is not (yet) deprecated, but is inelegant, and is used very little in Inform's
standard distribution. Requests to extend its abilities are very unlikely to be
heeded: it is more likely that we will curtail or abolish it.
</p>

<p class="commentary">The source text inside the <span class="extract"><span class="extract-syntax">(+</span></span> and <span class="extract"><span class="extract-syntax">+)</span></span> markers is evaluated as an expression,
rather than in void context, except that property names evaluate as nouns
referring to the property in the abstract rather than as conditions testing
those properties. Names of kinds of object (only) evaluate to Inter class
references for them. (Other kinds do not have Inter class references.)
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">CSIInline::from_source_text</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">CSIInline::from_source_text</span></span>:<br/><a href="5-cii.html#SP5">&#167;5</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">value_holster</span><span class="plain-syntax"> *</span><span class="identifier-syntax">VH</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">opaque_state</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">prim_cat</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="5-cii.html#SP13" class="function-link"><span class="function-syntax">CSIInline::eval_bracket_plus</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">VH</span><span class="plain-syntax">, </span><span class="identifier-syntax">Feeds::feed_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">), </span><span class="identifier-syntax">prim_cat</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP13" class="paragraph-anchor"></a><b>&#167;13. </b>This case, where orthodox compilation is happening, is more tolerable. Run the
test case <span class="extract"><span class="extract-syntax">BracketPlus</span></span> to exercise every part of this function.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">CSIInline::eval_bracket_plus</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">CSIInline::eval_bracket_plus</span></span>:<br/><a href="5-cii.html#SP12">&#167;12</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">value_holster</span><span class="plain-syntax"> *</span><span class="identifier-syntax">VH</span><span class="plain-syntax">, </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">LW</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">prim_cat</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;property-name&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">LW</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><a href="5-cii.html#SP13" class="function-link"><span class="function-syntax">CSIInline::eval_to_iname</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">RTProperties::iname</span><span class="plain-syntax">(</span><span class="function-syntax">&lt;&lt;rp&gt;&gt;</span><span class="plain-syntax">), </span><span class="identifier-syntax">prim_cat</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;k-kind&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">LW</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="function-syntax">&lt;&lt;rp&gt;&gt;</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Behaviour::is_subkind_of_object</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><a href="5-cii.html#SP13" class="function-link"><span class="function-syntax">CSIInline::eval_to_iname</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">RTKindDeclarations::iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">), </span><span class="identifier-syntax">prim_cat</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;instance-of-object&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">LW</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax"> = </span><span class="function-syntax">&lt;&lt;rp&gt;&gt;</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><a href="5-cii.html#SP13" class="function-link"><span class="function-syntax">CSIInline::eval_to_iname</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">RTInstances::value_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">), </span><span class="identifier-syntax">prim_cat</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">adjective</span><span class="plain-syntax"> *</span><span class="identifier-syntax">adj</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Adjectives::parse</span><span class="plain-syntax">(</span><span class="identifier-syntax">LW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">adj</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">iname</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RTAdjectives::guess_a_test_function</span><span class="plain-syntax">(</span><span class="identifier-syntax">adj</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">iname</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><a href="5-cii.html#SP13" class="function-link"><span class="function-syntax">CSIInline::eval_to_iname</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">iname</span><span class="plain-syntax">, </span><span class="identifier-syntax">prim_cat</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">StandardProblems::unlocated_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(),</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">BelievedImpossible</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                </span><span class="string-syntax">"You tried to use '(+' and '+)' to expand to the Inter function "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"defining an adjective, but it was an adjective with no definition."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">nonlocal_variable</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nlv</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NonlocalVariables::parse_global</span><span class="plain-syntax">(</span><span class="identifier-syntax">LW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">nlv</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><a href="5-cii.html#SP13" class="function-link"><span class="function-syntax">CSIInline::eval_to_iname</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">RTVariables::iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">nlv</span><span class="plain-syntax">), </span><span class="identifier-syntax">prim_cat</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">prim_cat</span><span class="plain-syntax"> == </span><span class="identifier-syntax">REF_PRIM_CAT</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::unlocated_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(),</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">BelievedImpossible</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="string-syntax">"You tried to use '(+' and '+)' to store or modify something which "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"I'm unable to alter using code written this way."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">spec</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP13_1" class="named-paragraph-link"><span class="named-paragraph">Evaluate the text as a value</span><span class="named-paragraph-number">13.1</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><a href="2-cv.html#SP5" class="function-link"><span class="function-syntax">CompileValues::to_code_val</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">CSIInline::eval_to_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">iname</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">prim_cat</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">prim_cat</span><span class="plain-syntax"> == </span><span class="identifier-syntax">REF_PRIM_CAT</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::ref_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">iname</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::val_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><span class="identifier-syntax">iname</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP14" class="paragraph-anchor"></a><b>&#167;14. </b>The really bad case is this one, where we compile a sort of faux textual
representation. This is the functionality I would most like to remove from Inform.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">CSIInline::eval_bracket_plus_to_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">LW</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;property-name&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">LW</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">RTProperties::iname</span><span class="plain-syntax">(</span><span class="function-syntax">&lt;&lt;rp&gt;&gt;</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;instance-of-object&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">LW</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax"> = </span><span class="function-syntax">&lt;&lt;rp&gt;&gt;</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%~I"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">adjective</span><span class="plain-syntax"> *</span><span class="identifier-syntax">adj</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Adjectives::parse</span><span class="plain-syntax">(</span><span class="identifier-syntax">LW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">adj</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">iname</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RTAdjectives::guess_a_test_function</span><span class="plain-syntax">(</span><span class="identifier-syntax">adj</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">iname</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">iname</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">StandardProblems::unlocated_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">BelievedImpossible</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                </span><span class="string-syntax">"You tried to use '(+' and '+)' to expand to the Inter function "</span>
<span class="plain-syntax">                </span><span class="string-syntax">"defining an adjective, but it was an adjective with no definition."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;k-kind&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">LW</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="function-syntax">&lt;&lt;rp&gt;&gt;</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Behaviour::is_subkind_of_object</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">RTKindDeclarations::iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">nonlocal_variable</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nlv</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NonlocalVariables::parse_global</span><span class="plain-syntax">(</span><span class="identifier-syntax">LW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">nlv</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">PUT</span><span class="plain-syntax">(</span><span class="identifier-syntax">URL_SYMBOL_CHAR</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterSymbolsTable::write_symbol_URL</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">InterNames::to_symbol</span><span class="plain-syntax">(</span><span class="identifier-syntax">RTVariables::iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">nlv</span><span class="plain-syntax">)));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">PUT</span><span class="plain-syntax">(</span><span class="identifier-syntax">URL_SYMBOL_CHAR</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">spec</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-cii.html#SP13_1" class="named-paragraph-link"><span class="named-paragraph">Evaluate the text as a value</span><span class="named-paragraph-number">13.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Specifications::is_phrasal</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_wording</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">LW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_PhraseInBracketsPlus</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"In %1, you tried to use '(+' and '+)' to expand to a value computed by a "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"phrase, '%2', but these brackets can only be used with constant values."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"0"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">inter_pair</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><a href="2-cv.html#SP4" class="function-link"><span class="function-syntax">CompileValues::to_pair</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">InterValuePairs::is_symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">PUT</span><span class="plain-syntax">(</span><span class="identifier-syntax">URL_SYMBOL_CHAR</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::to_symbol_in</span><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Emit::current_enclosure</span><span class="plain-syntax">()-&gt;</span><span class="identifier-syntax">actual_package</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterSymbolsTable::write_symbol_URL</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">PUT</span><span class="plain-syntax">(</span><span class="identifier-syntax">URL_SYMBOL_CHAR</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">CodeGen::val_to_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">Emit::at</span><span class="plain-syntax">(), </span><span class="identifier-syntax">val</span><span class="plain-syntax">, </span><span class="identifier-syntax">Task::vm</span><span class="plain-syntax">());</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP13_1" class="paragraph-anchor"></a><b>&#167;13.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Evaluate the text as a value</span><span class="named-paragraph-number">13.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">initial_problem_count</span><span class="plain-syntax"> = </span><span class="identifier-syntax">problem_count</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;s-value&gt;</span><span class="plain-syntax">(</span><span class="identifier-syntax">LW</span><span class="plain-syntax">)) </span><span class="identifier-syntax">spec</span><span class="plain-syntax"> = </span><span class="function-syntax">&lt;&lt;rp&gt;&gt;</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">spec</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::new_UNKNOWN</span><span class="plain-syntax">(</span><span class="identifier-syntax">LW</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">initial_problem_count</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">problem_count</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Dash::check_value</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">initial_problem_count</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">problem_count</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-cii.html#SP13">&#167;13</a> and <a href="5-cii.html#SP14">&#167;14</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP15" class="paragraph-anchor"></a><b>&#167;15. </b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">CSIInline::emit_showme</span><button class="popup" onclick="togglePopup('usagePopup10')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup10">Usage of <span class="code-font"><span class="function-syntax">CSIInline::emit_showme</span></span>:<br/><a href="5-cii.html#SP6_5_11">&#167;6.5.11</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">spec</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Node::is</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">, </span><span class="identifier-syntax">PROPERTY_VALUE_NT</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">spec</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Lvalues::underlying_property</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Node::is</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">, </span><span class="identifier-syntax">CONSTANT_NT</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"\"%+W\" = "</span><span class="plain-syntax">, </span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%u: "</span><span class="plain-syntax">, </span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">PRINT_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::val_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">)</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::get_construct</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">) == </span><span class="identifier-syntax">CON_list_of</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::call</span><span class="plain-syntax">(</span><span class="identifier-syntax">Hierarchy::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">LIST_OF_TY_SAY_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><a href="2-cv.html#SP5" class="function-link"><span class="function-syntax">CompileValues::to_code_val</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">EmitCode::val_number</span><span class="plain-syntax">(1);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::call</span><span class="plain-syntax">(</span><span class="identifier-syntax">RTKindConstructors::printing_fn_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><a href="2-cv.html#SP5" class="function-link"><span class="function-syntax">CompileValues::to_code_val</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::inv</span><span class="plain-syntax">(</span><span class="identifier-syntax">PRINT_BIP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::down</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EmitCode::val_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitCode::up</span><span class="plain-syntax">();</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="5-ciac.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-im.html">1</a></li><li class="progresschapter"><a href="2-cv.html">2</a></li><li class="progresschapter"><a href="3-sf.html">3</a></li><li class="progresschapter"><a href="4-cs.html">4</a></li><li class="progresscurrentchapter">5</li><li class="progresssection"><a href="5-cbal.html">cbal</a></li><li class="progresssection"><a href="5-ci.html">ci</a></li><li class="progresssection"><a href="5-ciac.html">ciac</a></li><li class="progresscurrent">cii</li><li class="progresssection"><a href="5-cste.html">cste</a></li><li class="progresssection"><a href="5-ca.html">ca</a></li><li class="progressnext"><a href="5-cste.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

